@opensig/opendesign
Version:
324 lines (323 loc) • 7.92 kB
JavaScript
"use strict";
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
require("../cascader/index.js");
require("../select/index.js");
const types = require("../cascader/types.js");
const types$1 = require("../select/types.js");
const { modelValue } = types.cascaderProps;
const { round, color, variant, disabled, loading, clearable, multiple, placeholder } = types$1.selectProps;
const cascaderV2Props = {
/**
* @zh-CN 级联选择器选中值(v-model)
* @en-US Cascader selected value (v-model)
* @CascaderValueT string | number | Array<string | number>
*/
modelValue,
/**
* @zh-CN 级联选择器选项值
* @en-US Cascader option value
* @CascaderOptionT { value: string | number, label?: string, children?: Array<CascaderOptionT> }
*/
options: {
type: Array
},
/**
* @zh-CN 选择框大小
* @en-US Select box size.
* @default 'large'
*/
size: {
type: String,
default: "large"
},
/**
* @zh-CN 选择框圆角
* @en-US Select the rounded corners of the box
*/
round,
/**
* @zh-CN 选择框颜色
* @en-US Select box color.
* @default 'normal'
*/
color,
/**
* @zh-CN 选择框变体
* @en-US Selection box variant.
* @default 'outline'
*/
variant,
/**
* @zh-CN 支持禁用
* @en-US Support disabling.
*/
disabled,
/**
* @zh-CN 加载中
* @en-US loading.
*/
loading,
/**
* @zh-CN 支持快速清除
* @en-US Support quick clearing.
*/
clearable,
/**
* @zh-CN 支持多选
* @en-US Support multiple selections.
*/
multiple,
/**
* @zh-CN 选择框提示文本
* @en-US Select box prompt text.
*/
placeholder,
/**
* @zh-CN 支持筛选
* @en-US Whether to support filtering.
*/
filterable: {
type: Boolean
},
/**
* @zh-CN 多选标签最大显示数量
* @en-US Maximum display quantity of multiple selection tags.
*/
maxTagCount: {
type: Number
},
/**
* @zh-CN 多选超过最大tag时,以文本显示
* @en-US When multiple selections exceed the maximum tag, they will be displayed as text.
*/
foldLabel: {
type: Function
},
/**
* @zh-CN 浮层显示收起的多选tag
* @en-US The floating layer shows the multiple selected tags that have been folded.
* @default 'hover'
*/
showFoldTags: {
type: [Boolean, String],
default: "hover"
},
/**
* @zh-CN 选择前回调,根据返回值判断是否显示
* @en-US Select the pre-callback and determine whether to display based on the return value.
*/
beforeSelect: {
type: Function
},
/**
* @zh-CN 过渡名称
* @en-US Transition name.
*/
transition: {
type: String
},
/**
* @zh-CN 是否在结束选择时,卸载所有选项,v-model
* @en-US Whether to uninstall all options when ending the selection.
* @default true
*/
unmountOnHide: {
type: Boolean,
default: true
},
/**
* @zh-CN 选项布局位置
* @en-US Option layout location.
* @default 'bl'
*/
optionPosition: {
type: String,
default: "bl"
},
/**
* @zh-CN 选项挂载容器,默认为body
* @en-US The option mounts the container, with the default being body.
* @default 'body'
*/
optionsWrapper: {
type: [String, Object],
default: "body"
},
/**
* @zh-CN 选项触发方式
* @en-US Option trigger method.
* @default 'click-outclick'
*/
trigger: {
type: String,
default: "click-outclick"
},
/**
* @zh-CN 选项宽度自适应规则
* 'auto': 自动
* 'min-width': 最小宽度与选择框一致
* 'width': 宽度与选择框一致
* @en-US Option width adaptive rule.
* 'auto': auto
* 'min-width': The minimum width is consistent with the selection box.
* 'width': The width is consistent with the selection box.
* @default 'min-width'
*/
optionWidthMode: {
type: String,
default: "auto"
},
/**
* @zh-CN 显示前回调,根据返回值判断是否显示
* @en-US Display the callback before display, and determine whether to display based on the return value.
*/
beforeOptionsShow: {
type: Function
},
/**
* @zh-CN 隐藏前回调,根据返回值判断是否隐藏
* @en-US Hide the previous callback and determine whether to hide it based on the return value.
*/
beforeOptionsHide: {
type: Function
},
/**
* @zh-CN modelValue 是否使用路径模式
* @en-US Whether to use path mode for modelValue
* @default false
*/
pathMode: {
type: Boolean,
default: false
},
/**
* @zh-CN 展开菜单选项的触发方式
* @en-US Trigger method to expand menu options
*/
expandTrigger: {
type: String,
default: "click"
},
/**
* @zh-CN 输入框中是否显示完整的路径
* @en-US Whether to display the complete path in the input box.
* @default true
*/
showAllLevels: {
type: Boolean,
default: true
},
/**
* @zh-CN 在选中节点改变时,是否返回由该节点所在的各级菜单的值所组成的数组,若设置 false,则只返回该节点的值
* @en-US Whether to return an array composed of the values of each level menu where the node is located when the selected node changes. If set to false, only the value of the node is returned.
* @default true
*/
emitPath: {
type: Boolean,
default: true
},
/**
* @zh-CN 是否允许选中任意节点,父子节点勾选互不关联
* @en-US Whether to allow selecting any node, parent and child nodes are checked independently.
* @default false
*/
allowSelectAnyNode: {
type: Boolean,
default: false
},
/**
* @zh-CN 是否动态加载子节点,需与 lazyLoad 方法结合使用
* @en-US whether to dynamic load child nodes, use with lazyload attribute.
* @default false
* TODO: 当允许懒加载时,若搜索的值还没加载为节点,此时应该如何展示搜索结果
*/
lazy: {
type: Boolean,
default: false
},
/**
* @zh-CN 加载动态数据的方法,仅在 lazy 为 true 时有效
* @en-US method for loading child nodes data, only works when lazy is true.
*/
lazyload: {
type: Function
}
};
const cascaderV2PanelProps = {
/**
* @zh-CN 级联选择器选中值(v-model)
* @en-US Cascader selected value (v-model)
*/
modelValue: {
type: [String, Number, Array],
default: ""
},
/**
* @zh-CN 级联选择器选项值
* @en-US Cascader option value
*/
options: {
type: Array
},
/**
* @zh-CN modelValue 是否使用路径模式
* @en-US Whether to use path mode for modelValue
* @default false
*/
pathMode: {
type: Boolean,
default: false
},
/**
* @zh-CN 展开菜单选项的触发方式
* @en-US Trigger method to expand menu options
* @default false
*/
expandTrigger: {
type: String,
default: "click"
},
/**
* @zh-CN 下拉面板大小
* @en-US Dropdown panel size.
* @default 'large'
*/
size: {
type: String,
default: "large"
},
/**
* @zh-CN 输入框中是否显示完整的路径
* @en-US Whether to display the complete path in the input box.
* @default true
*/
showAllLevels: {
type: Boolean,
default: true
},
/**
* @zh-CN 支持筛选
* @en-US Whether to support filtering.
*/
filterable: {
type: Boolean
},
/**
* @zh-CN 是否开启动态加载
* @en-US Whether to enable dynamic loading.
* @default false
*/
lazy: {
type: Boolean,
default: false
},
/**
* @zh-CN 动态加载数据的方法,仅在 lazy 为 true 时有效
* @en-US Method for dynamically loading data, only effective when lazy is true.
*/
lazyload: {
type: Function
}
};
exports.cascaderV2PanelProps = cascaderV2PanelProps;
exports.cascaderV2Props = cascaderV2Props;