kui-vue 6.4.0 → 6.5.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/ai/kui-components.json +249 -36
- package/dist/index.js +2 -2
- package/es/index.js +606 -194
- package/es/locale/de.js +1 -1
- package/es/locale/el.js +1 -1
- package/es/locale/en.js +1 -1
- package/es/locale/fr.js +1 -1
- package/es/locale/it.js +1 -1
- package/es/locale/ja.js +1 -1
- package/es/locale/ko.js +1 -1
- package/es/locale/ru.js +1 -1
- package/es/locale/th.js +1 -1
- package/es/locale/uk.js +1 -1
- package/es/locale/vi.js +1 -1
- package/es/locale/zh-CN.js +1 -1
- package/es/locale/zh-TW.js +1 -1
- package/lib/index.cjs +2 -2
- package/lib/locale/de.cjs +1 -1
- package/lib/locale/el.cjs +1 -1
- package/lib/locale/en.cjs +1 -1
- package/lib/locale/fr.cjs +1 -1
- package/lib/locale/it.cjs +1 -1
- package/lib/locale/ja.cjs +1 -1
- package/lib/locale/ko.cjs +1 -1
- package/lib/locale/ru.cjs +1 -1
- package/lib/locale/th.cjs +1 -1
- package/lib/locale/uk.cjs +1 -1
- package/lib/locale/vi.cjs +1 -1
- package/lib/locale/zh-CN.cjs +1 -1
- package/lib/locale/zh-TW.cjs +1 -1
- package/package.json +1 -1
- package/style/base.css +1 -1
- package/style/components.css +2 -2
- package/style/index.css +2 -2
- package/style/motion.css +1 -1
- package/style/theme.css +1 -1
- package/types/menu/menu-context.d.cts +1 -0
- package/types/menu/menu-context.d.ts +1 -0
- package/types/menu/menu.d.cts +13 -0
- package/types/menu/menu.d.ts +13 -0
- package/types/segmented/index.d.cts +2 -2
- package/types/segmented/index.d.ts +2 -2
- package/types/splitter/controller.d.cts +49 -0
- package/types/splitter/controller.d.ts +49 -0
- package/types/splitter/splitter-panel.d.cts +37 -2
- package/types/splitter/splitter-panel.d.ts +37 -2
- package/types/splitter/splitter.d.cts +24 -5
- package/types/splitter/splitter.d.ts +24 -5
- package/vetur/attributes.json +132 -12
- package/vetur/tags.json +24 -4
- package/vetur/web-types.json +157 -13
package/ai/kui-components.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "https://k-ui.cn/schema/kui-components.schema.json",
|
|
3
3
|
"library": "kui-vue",
|
|
4
|
-
"version": "6.
|
|
4
|
+
"version": "6.5.0",
|
|
5
5
|
"homepage": "https://k-ui.cn",
|
|
6
6
|
"components": [
|
|
7
7
|
{
|
|
@@ -11008,6 +11008,17 @@
|
|
|
11008
11008
|
"defaultExpression": "true",
|
|
11009
11009
|
"documented": true
|
|
11010
11010
|
},
|
|
11011
|
+
{
|
|
11012
|
+
"name": "subMenuOpenDelay",
|
|
11013
|
+
"description": "Hover-open delay for popup submenus in milliseconds; passing over does not open them. Set to 0 for immediate opening. Keyboard and inline click interactions remain immediate",
|
|
11014
|
+
"descriptionZh": "弹出式子菜单的鼠标悬停展开延迟(毫秒),快速经过不展开;设为 0 可立即展开,不影响键盘操作或 inline 点击展开",
|
|
11015
|
+
"descriptionEn": "Hover-open delay for popup submenus in milliseconds; passing over does not open them. Set to 0 for immediate opening. Keyboard and inline click interactions remain immediate",
|
|
11016
|
+
"type": "number",
|
|
11017
|
+
"boolean": false,
|
|
11018
|
+
"required": false,
|
|
11019
|
+
"defaultExpression": "200",
|
|
11020
|
+
"documented": true
|
|
11021
|
+
},
|
|
11011
11022
|
{
|
|
11012
11023
|
"name": "theme",
|
|
11013
11024
|
"description": "Local theme; inherits global theme when omitted",
|
|
@@ -14699,7 +14710,7 @@
|
|
|
14699
14710
|
{
|
|
14700
14711
|
"title": "带图标的选项",
|
|
14701
14712
|
"file": "components/segmented/demo/icon.vue",
|
|
14702
|
-
"source": "<template>\n <Segmented v-model=\"device\" :options=\"options\" />\n</template>\n\n<script setup lang=\"ts\">\nimport { Monitor, Smartphone, Tablet } from \"kui-icons\";\nimport { ref } from \"vue\";\n\nconst device = ref(\"desktop\");\nconst options = [\n { label: \"Desktop\", value: \"desktop\", icon: Monitor },\n { label: \"Tablet\", value: \"tablet\", icon: Tablet },\n { label: \"Mobile\", value: \"mobile\", icon: Smartphone },\n];\n</script>"
|
|
14713
|
+
"source": "<template>\n <Space vertical>\n <Segmented v-model=\"device\" :options=\"options\" />\n <Segmented v-model=\"layout\" :options=\"layoutOptions\" aria-label=\"Layout\" />\n </Space>\n</template>\n\n<script setup lang=\"ts\">\nimport { Monitor, Smartphone, Tablet, List, LayoutGrid } from \"kui-icons\";\nimport { ref } from \"vue\";\n\nconst device = ref(\"desktop\");\nconst layout = ref(\"list\");\nconst layoutOptions = [\n { value: \"list\", icon: List },\n { value: \"grid\", icon: LayoutGrid },\n];\nconst options = [\n { label: \"Desktop\", value: \"desktop\", icon: Monitor },\n { label: \"Tablet\", value: \"tablet\", icon: Tablet },\n { label: \"Mobile\", value: \"mobile\", icon: Smartphone },\n];\n</script>"
|
|
14703
14714
|
},
|
|
14704
14715
|
{
|
|
14705
14716
|
"title": "自定义标签",
|
|
@@ -18154,7 +18165,13 @@
|
|
|
18154
18165
|
"behavior": {
|
|
18155
18166
|
"rules": []
|
|
18156
18167
|
},
|
|
18157
|
-
"models": [
|
|
18168
|
+
"models": [
|
|
18169
|
+
{
|
|
18170
|
+
"prop": "modelValue",
|
|
18171
|
+
"event": "update:modelValue",
|
|
18172
|
+
"directive": "v-model"
|
|
18173
|
+
}
|
|
18174
|
+
],
|
|
18158
18175
|
"tags": [
|
|
18159
18176
|
"Splitter",
|
|
18160
18177
|
"KSplitter",
|
|
@@ -18166,27 +18183,94 @@
|
|
|
18166
18183
|
],
|
|
18167
18184
|
"documentation": "https://k-ui.cn/components/splitter",
|
|
18168
18185
|
"props": [
|
|
18186
|
+
{
|
|
18187
|
+
"name": "disabled",
|
|
18188
|
+
"description": "Disable pointer resizing, keyboard resizing and collapse controls",
|
|
18189
|
+
"descriptionZh": "禁用拖拽、键盘调整和折叠按钮",
|
|
18190
|
+
"descriptionEn": "Disable pointer resizing, keyboard resizing and collapse controls",
|
|
18191
|
+
"type": "boolean",
|
|
18192
|
+
"boolean": true,
|
|
18193
|
+
"enumValues": [
|
|
18194
|
+
false,
|
|
18195
|
+
true
|
|
18196
|
+
],
|
|
18197
|
+
"required": false,
|
|
18198
|
+
"documented": true
|
|
18199
|
+
},
|
|
18169
18200
|
{
|
|
18170
18201
|
"name": "direction",
|
|
18171
18202
|
"description": "Layout direction",
|
|
18172
18203
|
"descriptionZh": "布局方向",
|
|
18173
18204
|
"descriptionEn": "Layout direction",
|
|
18174
|
-
"type": "
|
|
18205
|
+
"type": "\"horizontal\" | \"vertical\"",
|
|
18175
18206
|
"boolean": false,
|
|
18176
18207
|
"enumValues": [
|
|
18177
18208
|
"horizontal",
|
|
18178
|
-
"vertical"
|
|
18179
|
-
"inline"
|
|
18209
|
+
"vertical"
|
|
18180
18210
|
],
|
|
18181
18211
|
"required": false,
|
|
18182
18212
|
"defaultExpression": "\"horizontal\"",
|
|
18183
18213
|
"documented": true
|
|
18184
18214
|
},
|
|
18215
|
+
{
|
|
18216
|
+
"name": "lazy",
|
|
18217
|
+
"description": "Move a preview guide and apply sizes on release",
|
|
18218
|
+
"descriptionZh": "拖动时只展示参考线,松开后应用尺寸",
|
|
18219
|
+
"descriptionEn": "Move a preview guide and apply sizes on release",
|
|
18220
|
+
"type": "boolean",
|
|
18221
|
+
"boolean": true,
|
|
18222
|
+
"enumValues": [
|
|
18223
|
+
false,
|
|
18224
|
+
true
|
|
18225
|
+
],
|
|
18226
|
+
"required": false,
|
|
18227
|
+
"documented": true
|
|
18228
|
+
},
|
|
18229
|
+
{
|
|
18230
|
+
"name": "modelValue",
|
|
18231
|
+
"description": "Current panel sizes in pixels; supports v-model",
|
|
18232
|
+
"descriptionZh": "当前面板尺寸数组(px),支持 v-model",
|
|
18233
|
+
"descriptionEn": "Current panel sizes in pixels; supports v-model",
|
|
18234
|
+
"type": "number[] | undefined",
|
|
18235
|
+
"boolean": false,
|
|
18236
|
+
"required": false,
|
|
18237
|
+
"documented": true
|
|
18238
|
+
},
|
|
18239
|
+
{
|
|
18240
|
+
"name": "value",
|
|
18241
|
+
"description": "Initial panel sizes in pixels; takes precedence over panel size",
|
|
18242
|
+
"descriptionZh": "初始面板尺寸数组(px),优先于面板的 size",
|
|
18243
|
+
"descriptionEn": "Initial panel sizes in pixels; takes precedence over panel size",
|
|
18244
|
+
"type": "number[] | undefined",
|
|
18245
|
+
"boolean": false,
|
|
18246
|
+
"required": false,
|
|
18247
|
+
"documented": true
|
|
18248
|
+
},
|
|
18249
|
+
{
|
|
18250
|
+
"name": "onUpdate:modelValue",
|
|
18251
|
+
"description": "Requests a new modelValue value (Current panel sizes in pixels; supports v-model); the payload is the new value. With v-model, Vue synchronizes the binding automatically; no additional update handler is needed.",
|
|
18252
|
+
"descriptionZh": "请求更新 modelValue(当前面板尺寸数组(px),支持 v-model),参数为更新后的值。使用 v-model 时由 Vue 自动同步绑定值,无需另写更新处理器。",
|
|
18253
|
+
"descriptionEn": "Requests a new modelValue value (Current panel sizes in pixels; supports v-model); the payload is the new value. With v-model, Vue synchronizes the binding automatically; no additional update handler is needed.",
|
|
18254
|
+
"type": "(sizes: number[]) => void",
|
|
18255
|
+
"eventName": "update:modelValue",
|
|
18256
|
+
"boolean": false,
|
|
18257
|
+
"documented": false
|
|
18258
|
+
},
|
|
18259
|
+
{
|
|
18260
|
+
"name": "onChange",
|
|
18261
|
+
"description": "Applied layout changed, including container resizing and collapsing",
|
|
18262
|
+
"descriptionZh": "已应用的布局变化时触发,包括容器缩放和折叠",
|
|
18263
|
+
"descriptionEn": "Applied layout changed, including container resizing and collapsing",
|
|
18264
|
+
"type": "(sizes: number[]) => void",
|
|
18265
|
+
"eventName": "change",
|
|
18266
|
+
"boolean": false,
|
|
18267
|
+
"documented": true
|
|
18268
|
+
},
|
|
18185
18269
|
{
|
|
18186
18270
|
"name": "onResize",
|
|
18187
|
-
"description": "
|
|
18188
|
-
"descriptionZh": "
|
|
18189
|
-
"descriptionEn": "
|
|
18271
|
+
"description": "Pointer or keyboard resizing; preview mode reports proposed sizes",
|
|
18272
|
+
"descriptionZh": "拖动或键盘调整时触发;参考线模式返回预览尺寸",
|
|
18273
|
+
"descriptionEn": "Pointer or keyboard resizing; preview mode reports proposed sizes",
|
|
18190
18274
|
"type": "(sizes: number[]) => void",
|
|
18191
18275
|
"eventName": "resize",
|
|
18192
18276
|
"boolean": false,
|
|
@@ -18194,9 +18278,9 @@
|
|
|
18194
18278
|
},
|
|
18195
18279
|
{
|
|
18196
18280
|
"name": "onResizeStart",
|
|
18197
|
-
"description": "
|
|
18198
|
-
"descriptionZh": "
|
|
18199
|
-
"descriptionEn": "
|
|
18281
|
+
"description": "Resizing started",
|
|
18282
|
+
"descriptionZh": "开始调整尺寸时触发",
|
|
18283
|
+
"descriptionEn": "Resizing started",
|
|
18200
18284
|
"type": "(sizes: number[]) => void",
|
|
18201
18285
|
"eventName": "resizeStart",
|
|
18202
18286
|
"boolean": false,
|
|
@@ -18204,36 +18288,67 @@
|
|
|
18204
18288
|
},
|
|
18205
18289
|
{
|
|
18206
18290
|
"name": "onResizeEnd",
|
|
18207
|
-
"description": "
|
|
18208
|
-
"descriptionZh": "
|
|
18209
|
-
"descriptionEn": "
|
|
18291
|
+
"description": "Resizing ended or was cancelled; reports final sizes",
|
|
18292
|
+
"descriptionZh": "结束或取消调整尺寸时触发,返回最终尺寸",
|
|
18293
|
+
"descriptionEn": "Resizing ended or was cancelled; reports final sizes",
|
|
18210
18294
|
"type": "(sizes: number[]) => void",
|
|
18211
18295
|
"eventName": "resizeEnd",
|
|
18212
18296
|
"boolean": false,
|
|
18213
18297
|
"documented": true
|
|
18298
|
+
},
|
|
18299
|
+
{
|
|
18300
|
+
"name": "onCollapse",
|
|
18301
|
+
"description": "Panel collapse toggled by a button; index starts at zero",
|
|
18302
|
+
"descriptionZh": "通过按钮切换面板折叠状态时触发,index 从 0 开始",
|
|
18303
|
+
"descriptionEn": "Panel collapse toggled by a button; index starts at zero",
|
|
18304
|
+
"type": "(index: number, collapsed: boolean) => void",
|
|
18305
|
+
"eventName": "collapse",
|
|
18306
|
+
"boolean": false,
|
|
18307
|
+
"documented": true
|
|
18214
18308
|
}
|
|
18215
18309
|
],
|
|
18216
18310
|
"events": [
|
|
18311
|
+
{
|
|
18312
|
+
"name": "update:modelValue",
|
|
18313
|
+
"type": "(sizes: number[]) => void",
|
|
18314
|
+
"description": "Requests a new modelValue value (Current panel sizes in pixels; supports v-model); the payload is the new value. With v-model, Vue synchronizes the binding automatically; no additional update handler is needed.",
|
|
18315
|
+
"descriptionZh": "请求更新 modelValue(当前面板尺寸数组(px),支持 v-model),参数为更新后的值。使用 v-model 时由 Vue 自动同步绑定值,无需另写更新处理器。",
|
|
18316
|
+
"descriptionEn": "Requests a new modelValue value (Current panel sizes in pixels; supports v-model); the payload is the new value. With v-model, Vue synchronizes the binding automatically; no additional update handler is needed."
|
|
18317
|
+
},
|
|
18318
|
+
{
|
|
18319
|
+
"name": "change",
|
|
18320
|
+
"type": "(sizes: number[]) => void",
|
|
18321
|
+
"description": "Applied layout changed, including container resizing and collapsing",
|
|
18322
|
+
"descriptionZh": "已应用的布局变化时触发,包括容器缩放和折叠",
|
|
18323
|
+
"descriptionEn": "Applied layout changed, including container resizing and collapsing"
|
|
18324
|
+
},
|
|
18217
18325
|
{
|
|
18218
18326
|
"name": "resize",
|
|
18219
18327
|
"type": "(sizes: number[]) => void",
|
|
18220
|
-
"description": "
|
|
18221
|
-
"descriptionZh": "
|
|
18222
|
-
"descriptionEn": "
|
|
18328
|
+
"description": "Pointer or keyboard resizing; preview mode reports proposed sizes",
|
|
18329
|
+
"descriptionZh": "拖动或键盘调整时触发;参考线模式返回预览尺寸",
|
|
18330
|
+
"descriptionEn": "Pointer or keyboard resizing; preview mode reports proposed sizes"
|
|
18223
18331
|
},
|
|
18224
18332
|
{
|
|
18225
18333
|
"name": "resizeStart",
|
|
18226
18334
|
"type": "(sizes: number[]) => void",
|
|
18227
|
-
"description": "
|
|
18228
|
-
"descriptionZh": "
|
|
18229
|
-
"descriptionEn": "
|
|
18335
|
+
"description": "Resizing started",
|
|
18336
|
+
"descriptionZh": "开始调整尺寸时触发",
|
|
18337
|
+
"descriptionEn": "Resizing started"
|
|
18230
18338
|
},
|
|
18231
18339
|
{
|
|
18232
18340
|
"name": "resizeEnd",
|
|
18233
18341
|
"type": "(sizes: number[]) => void",
|
|
18234
|
-
"description": "
|
|
18235
|
-
"descriptionZh": "
|
|
18236
|
-
"descriptionEn": "
|
|
18342
|
+
"description": "Resizing ended or was cancelled; reports final sizes",
|
|
18343
|
+
"descriptionZh": "结束或取消调整尺寸时触发,返回最终尺寸",
|
|
18344
|
+
"descriptionEn": "Resizing ended or was cancelled; reports final sizes"
|
|
18345
|
+
},
|
|
18346
|
+
{
|
|
18347
|
+
"name": "collapse",
|
|
18348
|
+
"type": "(index: number, collapsed: boolean) => void",
|
|
18349
|
+
"description": "Panel collapse toggled by a button; index starts at zero",
|
|
18350
|
+
"descriptionZh": "通过按钮切换面板折叠状态时触发,index 从 0 开始",
|
|
18351
|
+
"descriptionEn": "Panel collapse toggled by a button; index starts at zero"
|
|
18237
18352
|
}
|
|
18238
18353
|
],
|
|
18239
18354
|
"slots": [],
|
|
@@ -18244,9 +18359,24 @@
|
|
|
18244
18359
|
"source": "<template>\n <code>size: {{ sizes }}</code>\n <Splitter style=\"height: 200px; width: 100%\" @resize=\"resize\">\n <SplitterPanel><Text text=\"Left\" /></SplitterPanel>\n <SplitterPanel><Text text=\"Center\" /></SplitterPanel>\n <SplitterPanel><Text text=\"Right\" /></SplitterPanel>\n </Splitter>\n</template>\n<script lang=\"ts\" setup>\nimport { Flex } from \"kui-vue\";\nimport { h, ref } from \"vue\";\nconst sizes = ref<number[]>([]);\n\nconst resize = (value: number[]) => {\n sizes.value = value;\n};\nconst Text = (p: { text: string }) => {\n return h(\n Flex,\n { align: \"center\", justify: \"center\", style: { height: \"100%\", color: \"#aaa\" } },\n { default: () => p.text },\n );\n};\n</script>"
|
|
18245
18360
|
},
|
|
18246
18361
|
{
|
|
18247
|
-
"title": "
|
|
18362
|
+
"title": "垂直与嵌套布局",
|
|
18248
18363
|
"file": "components/splitter/demo/vertical.vue",
|
|
18249
18364
|
"source": "<template>\n <Splitter direction=\"horizontal\" style=\"height: 200px\">\n <SplitterPanel size=\"20%\" min=\"10%\" max=\"30%\"><Text text=\"Folders\" /></SplitterPanel>\n <SplitterPanel>\n <Splitter direction=\"vertical\">\n <SplitterPanel><Text text=\"Editor\" /></SplitterPanel>\n <SplitterPanel size=\"50px\"><Text text=\"Console\" /></SplitterPanel>\n </Splitter>\n </SplitterPanel>\n </Splitter>\n</template>\n<script lang=\"ts\" setup>\nimport { Flex } from \"kui-vue\";\nimport { h } from \"vue\";\n\nconst Text = (p: { text: string }) => {\n return h(\n Flex,\n { align: \"center\", justify: \"center\", style: { height: \"100%\", color: \"#aaa\" } },\n { default: () => p.text },\n );\n};\n</script>"
|
|
18365
|
+
},
|
|
18366
|
+
{
|
|
18367
|
+
"title": "折叠与锁定",
|
|
18368
|
+
"file": "components/splitter/demo/collapsible.vue",
|
|
18369
|
+
"source": "<template>\n <Splitter style=\"height: 220px\">\n <SplitterPanel v-model:collapsed=\"collapsed\" size=\"25%\" min=\"100px\" collapsible>\n <Flex align=\"center\" justify=\"center\" style=\"height: 100%\">Folders</Flex>\n </SplitterPanel>\n <SplitterPanel>\n <Flex align=\"center\" justify=\"center\" style=\"height: 100%\">Editor</Flex>\n </SplitterPanel>\n <SplitterPanel size=\"120px\" :resizable=\"false\">\n <Flex align=\"center\" justify=\"center\" style=\"height: 100%\">Locked</Flex>\n </SplitterPanel>\n </Splitter>\n <code>collapsed: {{ collapsed }}</code>\n</template>\n<script setup lang=\"ts\">\nimport { ref } from \"vue\";\nimport { Flex, Splitter, SplitterPanel } from \"kui-vue\";\nconst collapsed = ref(false);\n</script>"
|
|
18370
|
+
},
|
|
18371
|
+
{
|
|
18372
|
+
"title": "绑定与恢复布局",
|
|
18373
|
+
"file": "components/splitter/demo/controlled.vue",
|
|
18374
|
+
"source": "<template>\n <Space vertical style=\"width: 100%\">\n <Space>\n <Button @click=\"saved = [...sizes]\">Save layout</Button>\n <Button @click=\"sizes = [...saved]\">Restore layout</Button>\n </Space>\n <code>sizes: {{ sizes.map((size) => Math.round(size)).join(\", \") }}</code>\n <Splitter v-model=\"sizes\" style=\"height: 200px\">\n <SplitterPanel min=\"100px\">\n <Flex align=\"center\" justify=\"center\" style=\"height: 100%\">Left</Flex>\n </SplitterPanel>\n <SplitterPanel min=\"100px\">\n <Flex align=\"center\" justify=\"center\" style=\"height: 100%\">Right</Flex>\n </SplitterPanel>\n </Splitter>\n </Space>\n</template>\n<script setup lang=\"ts\">\nimport { ref } from \"vue\";\nimport { Button, Flex, Space, Splitter, SplitterPanel } from \"kui-vue\";\nconst sizes = ref([240, 556]);\nconst saved = ref([...sizes.value]);\n</script>"
|
|
18375
|
+
},
|
|
18376
|
+
{
|
|
18377
|
+
"title": "参考线拖动",
|
|
18378
|
+
"file": "components/splitter/demo/lazy.vue",
|
|
18379
|
+
"source": "<template>\n <Splitter lazy style=\"height: 220px\" @resize=\"preview = $event\" @change=\"applied = $event\">\n <SplitterPanel size=\"35%\" min=\"100px\">\n <Flex align=\"center\" justify=\"center\" style=\"height: 100%\">Chart</Flex>\n </SplitterPanel>\n <SplitterPanel min=\"100px\">\n <Flex align=\"center\" justify=\"center\" style=\"height: 100%\">Editor</Flex>\n </SplitterPanel>\n </Splitter>\n <div>\n <code>preview: {{ preview.map((size) => Math.round(size)).join(\", \") }}</code>\n </div>\n <div>\n <code>applied: {{ applied.map((size) => Math.round(size)).join(\", \") }}</code>\n </div>\n</template>\n<script setup lang=\"ts\">\nimport { ref } from \"vue\";\nimport { Flex, Splitter, SplitterPanel } from \"kui-vue\";\nconst preview = ref<number[]>([]);\nconst applied = ref<number[]>([]);\n</script>"
|
|
18250
18380
|
}
|
|
18251
18381
|
]
|
|
18252
18382
|
},
|
|
@@ -18255,7 +18385,13 @@
|
|
|
18255
18385
|
"behavior": {
|
|
18256
18386
|
"rules": []
|
|
18257
18387
|
},
|
|
18258
|
-
"models": [
|
|
18388
|
+
"models": [
|
|
18389
|
+
{
|
|
18390
|
+
"prop": "collapsed",
|
|
18391
|
+
"event": "update:collapsed",
|
|
18392
|
+
"directive": "v-model:collapsed"
|
|
18393
|
+
}
|
|
18394
|
+
],
|
|
18259
18395
|
"tags": [
|
|
18260
18396
|
"SplitterPanel",
|
|
18261
18397
|
"KSplitterPanel",
|
|
@@ -18266,11 +18402,40 @@
|
|
|
18266
18402
|
"children": [],
|
|
18267
18403
|
"documentation": "https://k-ui.cn/components/splitter",
|
|
18268
18404
|
"props": [
|
|
18405
|
+
{
|
|
18406
|
+
"name": "collapsible",
|
|
18407
|
+
"description": "Show this panel's collapse controls",
|
|
18408
|
+
"descriptionZh": "是否显示此面板的折叠按钮",
|
|
18409
|
+
"descriptionEn": "Show this panel's collapse controls",
|
|
18410
|
+
"type": "boolean",
|
|
18411
|
+
"boolean": true,
|
|
18412
|
+
"enumValues": [
|
|
18413
|
+
false,
|
|
18414
|
+
true
|
|
18415
|
+
],
|
|
18416
|
+
"required": false,
|
|
18417
|
+
"documented": true
|
|
18418
|
+
},
|
|
18419
|
+
{
|
|
18420
|
+
"name": "resizable",
|
|
18421
|
+
"description": "Allow resizing; when false, adjacent separators cannot be dragged and this panel cannot be collapsed by a button",
|
|
18422
|
+
"descriptionZh": "是否允许调整此面板;关闭后相邻分隔条不可拖动,面板不可通过按钮折叠",
|
|
18423
|
+
"descriptionEn": "Allow resizing; when false, adjacent separators cannot be dragged and this panel cannot be collapsed by a button",
|
|
18424
|
+
"type": "boolean",
|
|
18425
|
+
"boolean": true,
|
|
18426
|
+
"enumValues": [
|
|
18427
|
+
false,
|
|
18428
|
+
true
|
|
18429
|
+
],
|
|
18430
|
+
"required": false,
|
|
18431
|
+
"defaultExpression": "true",
|
|
18432
|
+
"documented": true
|
|
18433
|
+
},
|
|
18269
18434
|
{
|
|
18270
18435
|
"name": "size",
|
|
18271
|
-
"description": "Initial size; numbers are px, strings
|
|
18436
|
+
"description": "Initial size; numbers are px, strings accept px or percentages",
|
|
18272
18437
|
"descriptionZh": "初始尺寸;数字为 px,字符串支持 px 或百分比",
|
|
18273
|
-
"descriptionEn": "Initial size; numbers are px, strings
|
|
18438
|
+
"descriptionEn": "Initial size; numbers are px, strings accept px or percentages",
|
|
18274
18439
|
"type": "string | number | undefined",
|
|
18275
18440
|
"boolean": false,
|
|
18276
18441
|
"required": false,
|
|
@@ -18278,9 +18443,9 @@
|
|
|
18278
18443
|
},
|
|
18279
18444
|
{
|
|
18280
18445
|
"name": "max",
|
|
18281
|
-
"description": "Maximum size; numbers are px, strings
|
|
18282
|
-
"descriptionZh": "
|
|
18283
|
-
"descriptionEn": "Maximum size; numbers are px, strings
|
|
18446
|
+
"description": "Maximum expanded size; numbers are px, strings accept px or percentages",
|
|
18447
|
+
"descriptionZh": "展开时的最大尺寸;数字为 px,字符串支持 px 或百分比",
|
|
18448
|
+
"descriptionEn": "Maximum expanded size; numbers are px, strings accept px or percentages",
|
|
18284
18449
|
"type": "string | number | undefined",
|
|
18285
18450
|
"boolean": false,
|
|
18286
18451
|
"required": false,
|
|
@@ -18288,16 +18453,49 @@
|
|
|
18288
18453
|
},
|
|
18289
18454
|
{
|
|
18290
18455
|
"name": "min",
|
|
18291
|
-
"description": "Minimum size; numbers are px, strings
|
|
18292
|
-
"descriptionZh": "
|
|
18293
|
-
"descriptionEn": "Minimum size; numbers are px, strings
|
|
18456
|
+
"description": "Minimum expanded size; numbers are px, strings accept px or percentages",
|
|
18457
|
+
"descriptionZh": "展开时的最小尺寸;数字为 px,字符串支持 px 或百分比",
|
|
18458
|
+
"descriptionEn": "Minimum expanded size; numbers are px, strings accept px or percentages",
|
|
18294
18459
|
"type": "string | number | undefined",
|
|
18295
18460
|
"boolean": false,
|
|
18296
18461
|
"required": false,
|
|
18297
18462
|
"documented": true
|
|
18463
|
+
},
|
|
18464
|
+
{
|
|
18465
|
+
"name": "collapsed",
|
|
18466
|
+
"description": "Collapse to zero size; supports v-model:collapsed",
|
|
18467
|
+
"descriptionZh": "是否折叠,支持 v-model:collapsed,折叠尺寸为 0",
|
|
18468
|
+
"descriptionEn": "Collapse to zero size; supports v-model:collapsed",
|
|
18469
|
+
"type": "boolean | undefined",
|
|
18470
|
+
"boolean": true,
|
|
18471
|
+
"enumValues": [
|
|
18472
|
+
false,
|
|
18473
|
+
true
|
|
18474
|
+
],
|
|
18475
|
+
"required": false,
|
|
18476
|
+
"defaultExpression": "undefined",
|
|
18477
|
+
"documented": true
|
|
18478
|
+
},
|
|
18479
|
+
{
|
|
18480
|
+
"name": "onUpdate:collapsed",
|
|
18481
|
+
"description": "Requests a new collapsed value (Collapse to zero size; supports v-model:collapsed); the payload is the new value. With v-model:collapsed, Vue synchronizes the binding automatically; no additional update handler is needed.",
|
|
18482
|
+
"descriptionZh": "请求更新 collapsed(是否折叠,支持 v-model:collapsed,折叠尺寸为 0),参数为更新后的值。使用 v-model:collapsed 时由 Vue 自动同步绑定值,无需另写更新处理器。",
|
|
18483
|
+
"descriptionEn": "Requests a new collapsed value (Collapse to zero size; supports v-model:collapsed); the payload is the new value. With v-model:collapsed, Vue synchronizes the binding automatically; no additional update handler is needed.",
|
|
18484
|
+
"type": "(collapsed: boolean) => void",
|
|
18485
|
+
"eventName": "update:collapsed",
|
|
18486
|
+
"boolean": false,
|
|
18487
|
+
"documented": false
|
|
18488
|
+
}
|
|
18489
|
+
],
|
|
18490
|
+
"events": [
|
|
18491
|
+
{
|
|
18492
|
+
"name": "update:collapsed",
|
|
18493
|
+
"type": "(collapsed: boolean) => void",
|
|
18494
|
+
"description": "Requests a new collapsed value (Collapse to zero size; supports v-model:collapsed); the payload is the new value. With v-model:collapsed, Vue synchronizes the binding automatically; no additional update handler is needed.",
|
|
18495
|
+
"descriptionZh": "请求更新 collapsed(是否折叠,支持 v-model:collapsed,折叠尺寸为 0),参数为更新后的值。使用 v-model:collapsed 时由 Vue 自动同步绑定值,无需另写更新处理器。",
|
|
18496
|
+
"descriptionEn": "Requests a new collapsed value (Collapse to zero size; supports v-model:collapsed); the payload is the new value. With v-model:collapsed, Vue synchronizes the binding automatically; no additional update handler is needed."
|
|
18298
18497
|
}
|
|
18299
18498
|
],
|
|
18300
|
-
"events": [],
|
|
18301
18499
|
"slots": [],
|
|
18302
18500
|
"examples": [
|
|
18303
18501
|
{
|
|
@@ -18306,9 +18504,24 @@
|
|
|
18306
18504
|
"source": "<template>\n <code>size: {{ sizes }}</code>\n <Splitter style=\"height: 200px; width: 100%\" @resize=\"resize\">\n <SplitterPanel><Text text=\"Left\" /></SplitterPanel>\n <SplitterPanel><Text text=\"Center\" /></SplitterPanel>\n <SplitterPanel><Text text=\"Right\" /></SplitterPanel>\n </Splitter>\n</template>\n<script lang=\"ts\" setup>\nimport { Flex } from \"kui-vue\";\nimport { h, ref } from \"vue\";\nconst sizes = ref<number[]>([]);\n\nconst resize = (value: number[]) => {\n sizes.value = value;\n};\nconst Text = (p: { text: string }) => {\n return h(\n Flex,\n { align: \"center\", justify: \"center\", style: { height: \"100%\", color: \"#aaa\" } },\n { default: () => p.text },\n );\n};\n</script>"
|
|
18307
18505
|
},
|
|
18308
18506
|
{
|
|
18309
|
-
"title": "
|
|
18507
|
+
"title": "垂直与嵌套布局",
|
|
18310
18508
|
"file": "components/splitter/demo/vertical.vue",
|
|
18311
18509
|
"source": "<template>\n <Splitter direction=\"horizontal\" style=\"height: 200px\">\n <SplitterPanel size=\"20%\" min=\"10%\" max=\"30%\"><Text text=\"Folders\" /></SplitterPanel>\n <SplitterPanel>\n <Splitter direction=\"vertical\">\n <SplitterPanel><Text text=\"Editor\" /></SplitterPanel>\n <SplitterPanel size=\"50px\"><Text text=\"Console\" /></SplitterPanel>\n </Splitter>\n </SplitterPanel>\n </Splitter>\n</template>\n<script lang=\"ts\" setup>\nimport { Flex } from \"kui-vue\";\nimport { h } from \"vue\";\n\nconst Text = (p: { text: string }) => {\n return h(\n Flex,\n { align: \"center\", justify: \"center\", style: { height: \"100%\", color: \"#aaa\" } },\n { default: () => p.text },\n );\n};\n</script>"
|
|
18510
|
+
},
|
|
18511
|
+
{
|
|
18512
|
+
"title": "折叠与锁定",
|
|
18513
|
+
"file": "components/splitter/demo/collapsible.vue",
|
|
18514
|
+
"source": "<template>\n <Splitter style=\"height: 220px\">\n <SplitterPanel v-model:collapsed=\"collapsed\" size=\"25%\" min=\"100px\" collapsible>\n <Flex align=\"center\" justify=\"center\" style=\"height: 100%\">Folders</Flex>\n </SplitterPanel>\n <SplitterPanel>\n <Flex align=\"center\" justify=\"center\" style=\"height: 100%\">Editor</Flex>\n </SplitterPanel>\n <SplitterPanel size=\"120px\" :resizable=\"false\">\n <Flex align=\"center\" justify=\"center\" style=\"height: 100%\">Locked</Flex>\n </SplitterPanel>\n </Splitter>\n <code>collapsed: {{ collapsed }}</code>\n</template>\n<script setup lang=\"ts\">\nimport { ref } from \"vue\";\nimport { Flex, Splitter, SplitterPanel } from \"kui-vue\";\nconst collapsed = ref(false);\n</script>"
|
|
18515
|
+
},
|
|
18516
|
+
{
|
|
18517
|
+
"title": "绑定与恢复布局",
|
|
18518
|
+
"file": "components/splitter/demo/controlled.vue",
|
|
18519
|
+
"source": "<template>\n <Space vertical style=\"width: 100%\">\n <Space>\n <Button @click=\"saved = [...sizes]\">Save layout</Button>\n <Button @click=\"sizes = [...saved]\">Restore layout</Button>\n </Space>\n <code>sizes: {{ sizes.map((size) => Math.round(size)).join(\", \") }}</code>\n <Splitter v-model=\"sizes\" style=\"height: 200px\">\n <SplitterPanel min=\"100px\">\n <Flex align=\"center\" justify=\"center\" style=\"height: 100%\">Left</Flex>\n </SplitterPanel>\n <SplitterPanel min=\"100px\">\n <Flex align=\"center\" justify=\"center\" style=\"height: 100%\">Right</Flex>\n </SplitterPanel>\n </Splitter>\n </Space>\n</template>\n<script setup lang=\"ts\">\nimport { ref } from \"vue\";\nimport { Button, Flex, Space, Splitter, SplitterPanel } from \"kui-vue\";\nconst sizes = ref([240, 556]);\nconst saved = ref([...sizes.value]);\n</script>"
|
|
18520
|
+
},
|
|
18521
|
+
{
|
|
18522
|
+
"title": "参考线拖动",
|
|
18523
|
+
"file": "components/splitter/demo/lazy.vue",
|
|
18524
|
+
"source": "<template>\n <Splitter lazy style=\"height: 220px\" @resize=\"preview = $event\" @change=\"applied = $event\">\n <SplitterPanel size=\"35%\" min=\"100px\">\n <Flex align=\"center\" justify=\"center\" style=\"height: 100%\">Chart</Flex>\n </SplitterPanel>\n <SplitterPanel min=\"100px\">\n <Flex align=\"center\" justify=\"center\" style=\"height: 100%\">Editor</Flex>\n </SplitterPanel>\n </Splitter>\n <div>\n <code>preview: {{ preview.map((size) => Math.round(size)).join(\", \") }}</code>\n </div>\n <div>\n <code>applied: {{ applied.map((size) => Math.round(size)).join(\", \") }}</code>\n </div>\n</template>\n<script setup lang=\"ts\">\nimport { ref } from \"vue\";\nimport { Flex, Splitter, SplitterPanel } from \"kui-vue\";\nconst preview = ref<number[]>([]);\nconst applied = ref<number[]>([]);\n</script>"
|
|
18312
18525
|
}
|
|
18313
18526
|
]
|
|
18314
18527
|
},
|