fast-element-plus 1.0.7 → 1.0.10
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/index.full.js +894 -757
- package/dist/index.full.js.map +1 -1
- package/dist/index.full.min.js +1 -1
- package/dist/index.full.min.js.map +1 -1
- package/dist/index.full.min.mjs +1 -1
- package/dist/index.full.min.mjs.map +1 -1
- package/dist/index.full.mjs +894 -757
- package/dist/index.full.mjs.map +1 -1
- package/dist/styles/index.css +41 -23
- package/dist/styles/index.css.map +1 -1
- package/es/components/avatar/src/avatar.d.ts +4 -4
- package/es/components/avatar/src/avatar.mjs +1 -1
- package/es/components/avatar/src/avatar.mjs.map +1 -1
- package/es/components/button/src/button.mjs.map +1 -1
- package/es/components/carNumber/src/carNumber.d.ts +13 -5
- package/es/components/carNumber/src/carNumber.mjs +1 -1
- package/es/components/carNumber/src/carNumber.mjs.map +1 -1
- package/es/components/contextMenu/src/contextMenu.mjs +1 -1
- package/es/components/contextMenu/src/contextMenu.mjs.map +1 -1
- package/es/components/dialog/src/dialog.d.ts +4 -4
- package/es/components/dialog/src/dialog.mjs +1 -1
- package/es/components/dialog/src/dialog.mjs.map +1 -1
- package/es/components/drawer/src/drawer.d.ts +12 -4
- package/es/components/drawer/src/drawer.mjs +1 -1
- package/es/components/drawer/src/drawer.mjs.map +1 -1
- package/es/components/form/src/form.mjs +1 -1
- package/es/components/form/src/form.mjs.map +1 -1
- package/es/components/form/src/formItem.mjs +1 -1
- package/es/components/form/src/formItem.mjs.map +1 -1
- package/es/components/formItemTip/src/formItemTip.mjs +1 -1
- package/es/components/formItemTip/src/formItemTip.mjs.map +1 -1
- package/es/components/icon/src/icon.mjs +1 -1
- package/es/components/icon/src/icon.mjs.map +1 -1
- package/es/components/iconSelector/src/iconSelector.mjs +1 -1
- package/es/components/iconSelector/src/iconSelector.mjs.map +1 -1
- package/es/components/image/src/image.mjs +1 -1
- package/es/components/image/src/image.mjs.map +1 -1
- package/es/components/index.d.ts +1 -0
- package/es/components/index.mjs +1 -1
- package/es/components/inputDialogPage/index.d.ts +14 -0
- package/es/components/inputDialogPage/index.mjs +2 -0
- package/es/components/inputDialogPage/index.mjs.map +1 -0
- package/es/components/inputDialogPage/src/inputDialogPage.d.ts +131 -0
- package/es/components/inputDialogPage/src/inputDialogPage.mjs +2 -0
- package/es/components/inputDialogPage/src/inputDialogPage.mjs.map +1 -0
- package/es/components/layoutGrid/src/layoutGrid.mjs +1 -1
- package/es/components/layoutGrid/src/layoutGrid.mjs.map +1 -1
- package/es/components/layoutGrid/src/layoutGridItem.d.ts +6 -6
- package/es/components/layoutGrid/src/layoutGridItem.mjs +1 -1
- package/es/components/layoutGrid/src/layoutGridItem.mjs.map +1 -1
- package/es/components/select/src/select.d.ts +39 -34
- package/es/components/select/src/select.mjs +1 -1
- package/es/components/select/src/select.mjs.map +1 -1
- package/es/components/select/src/selectOption.mjs +1 -1
- package/es/components/select/src/selectOption.mjs.map +1 -1
- package/es/components/selectPage/src/selectPage.d.ts +39 -25
- package/es/components/selectPage/src/selectPage.mjs +1 -1
- package/es/components/selectPage/src/selectPage.mjs.map +1 -1
- package/es/components/selectV2/src/selectV2.d.ts +36 -44
- package/es/components/selectV2/src/selectV2.mjs +1 -1
- package/es/components/selectV2/src/selectV2.mjs.map +1 -1
- package/es/components/table/src/table.d.ts +6 -6
- package/es/components/table/src/table.mjs +1 -1
- package/es/components/table/src/table.mjs.map +1 -1
- package/es/components/table/src/table.type.d.ts +1 -1
- package/es/components/table/src/table.type.mjs.map +1 -1
- package/es/components/table/src/tableColumn.mjs +1 -1
- package/es/components/table/src/tableColumn.mjs.map +1 -1
- package/es/components/table/src/tableColumnSettingDialog.mjs +1 -1
- package/es/components/table/src/tableColumnSettingDialog.mjs.map +1 -1
- package/es/components/table/src/useTable.mjs +1 -1
- package/es/components/table/src/useTable.mjs.map +1 -1
- package/es/components/table/utils/table.mjs +1 -1
- package/es/components/table/utils/table.mjs.map +1 -1
- package/es/components/tree/src/tree.d.ts +68 -174
- package/es/components/tree/src/tree.mjs +1 -1
- package/es/components/tree/src/tree.mjs.map +1 -1
- package/es/components/treeSelect/src/treeSelect.d.ts +123 -221
- package/es/components/treeSelect/src/treeSelect.mjs +1 -1
- package/es/components/treeSelect/src/treeSelect.mjs.map +1 -1
- package/es/directives/click-copy/index.mjs.map +1 -1
- package/es/directives/click-debounce/index.mjs.map +1 -1
- package/es/directives/click-draggable/index.mjs.map +1 -1
- package/es/directives/click-icon-copy/index.mjs.map +1 -1
- package/es/directives/click-longpress/index.mjs.map +1 -1
- package/es/directives/click-throttle/index.mjs.map +1 -1
- package/es/index.mjs +1 -1
- package/es/index.mjs.map +1 -1
- package/es/make-installer.mjs +1 -1
- package/es/make-installer.mjs.map +1 -1
- package/es/version.d.ts +1 -1
- package/es/version.mjs +1 -1
- package/es/version.mjs.map +1 -1
- package/lib/components/avatar/src/avatar.d.ts +4 -4
- package/lib/components/avatar/src/avatar.js +1 -1
- package/lib/components/avatar/src/avatar.js.map +1 -1
- package/lib/components/button/src/button.js.map +1 -1
- package/lib/components/carNumber/src/carNumber.d.ts +13 -5
- package/lib/components/carNumber/src/carNumber.js +1 -1
- package/lib/components/carNumber/src/carNumber.js.map +1 -1
- package/lib/components/contextMenu/src/contextMenu.js +1 -1
- package/lib/components/contextMenu/src/contextMenu.js.map +1 -1
- package/lib/components/dialog/src/dialog.d.ts +4 -4
- package/lib/components/dialog/src/dialog.js +1 -1
- package/lib/components/dialog/src/dialog.js.map +1 -1
- package/lib/components/drawer/src/drawer.d.ts +12 -4
- package/lib/components/drawer/src/drawer.js +1 -1
- package/lib/components/drawer/src/drawer.js.map +1 -1
- package/lib/components/form/src/form.js +1 -1
- package/lib/components/form/src/form.js.map +1 -1
- package/lib/components/form/src/formItem.js +1 -1
- package/lib/components/form/src/formItem.js.map +1 -1
- package/lib/components/formItemTip/src/formItemTip.js +1 -1
- package/lib/components/formItemTip/src/formItemTip.js.map +1 -1
- package/lib/components/icon/src/icon.js +1 -1
- package/lib/components/icon/src/icon.js.map +1 -1
- package/lib/components/iconSelector/src/iconSelector.js +1 -1
- package/lib/components/iconSelector/src/iconSelector.js.map +1 -1
- package/lib/components/image/src/image.js +1 -1
- package/lib/components/image/src/image.js.map +1 -1
- package/lib/components/index.d.ts +1 -0
- package/lib/components/index.js +1 -1
- package/lib/components/inputDialogPage/index.d.ts +14 -0
- package/lib/components/inputDialogPage/index.js +2 -0
- package/lib/components/inputDialogPage/index.js.map +1 -0
- package/lib/components/inputDialogPage/src/inputDialogPage.d.ts +131 -0
- package/lib/components/inputDialogPage/src/inputDialogPage.js +2 -0
- package/lib/components/inputDialogPage/src/inputDialogPage.js.map +1 -0
- package/lib/components/layoutGrid/src/layoutGrid.js +1 -1
- package/lib/components/layoutGrid/src/layoutGrid.js.map +1 -1
- package/lib/components/layoutGrid/src/layoutGridItem.d.ts +6 -6
- package/lib/components/layoutGrid/src/layoutGridItem.js +1 -1
- package/lib/components/layoutGrid/src/layoutGridItem.js.map +1 -1
- package/lib/components/select/src/select.d.ts +39 -34
- package/lib/components/select/src/select.js +1 -1
- package/lib/components/select/src/select.js.map +1 -1
- package/lib/components/select/src/selectOption.js +1 -1
- package/lib/components/select/src/selectOption.js.map +1 -1
- package/lib/components/selectPage/src/selectPage.d.ts +39 -25
- package/lib/components/selectPage/src/selectPage.js +1 -1
- package/lib/components/selectPage/src/selectPage.js.map +1 -1
- package/lib/components/selectV2/src/selectV2.d.ts +36 -44
- package/lib/components/selectV2/src/selectV2.js +1 -1
- package/lib/components/selectV2/src/selectV2.js.map +1 -1
- package/lib/components/table/src/table.d.ts +6 -6
- package/lib/components/table/src/table.js +1 -1
- package/lib/components/table/src/table.js.map +1 -1
- package/lib/components/table/src/table.type.d.ts +1 -1
- package/lib/components/table/src/table.type.js.map +1 -1
- package/lib/components/table/src/tableColumn.js +1 -1
- package/lib/components/table/src/tableColumn.js.map +1 -1
- package/lib/components/table/src/tableColumnSettingDialog.js +1 -1
- package/lib/components/table/src/tableColumnSettingDialog.js.map +1 -1
- package/lib/components/table/src/useTable.js.map +1 -1
- package/lib/components/table/utils/table.js +1 -1
- package/lib/components/table/utils/table.js.map +1 -1
- package/lib/components/tree/src/tree.d.ts +68 -174
- package/lib/components/tree/src/tree.js +1 -1
- package/lib/components/tree/src/tree.js.map +1 -1
- package/lib/components/treeSelect/src/treeSelect.d.ts +123 -221
- package/lib/components/treeSelect/src/treeSelect.js +1 -1
- package/lib/components/treeSelect/src/treeSelect.js.map +1 -1
- package/lib/directives/click-copy/index.js.map +1 -1
- package/lib/directives/click-debounce/index.js.map +1 -1
- package/lib/directives/click-draggable/index.js.map +1 -1
- package/lib/directives/click-icon-copy/index.js.map +1 -1
- package/lib/directives/click-longpress/index.js.map +1 -1
- package/lib/directives/click-throttle/index.js.map +1 -1
- package/lib/index.js +1 -1
- package/lib/index.js.map +1 -1
- package/lib/make-installer.js.map +1 -1
- package/lib/version.d.ts +1 -1
- package/lib/version.js +1 -1
- package/lib/version.js.map +1 -1
- package/package.json +3 -3
- package/styles/components/dialog.scss +1 -1
- package/styles/components/select.scss +35 -0
- package/styles/components/selectPage.scss +0 -30
- package/styles/components/table.scss +1 -1
- package/styles/components/tree.scss +17 -2
- package/styles/index.scss +1 -0
- package/types/components.d.ts +110 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"treeSelect.mjs","sources":["../../../../../packages/components/treeSelect/src/treeSelect.tsx"],"sourcesContent":["import { computed, defineComponent, onMounted, reactive, ref, watch } from \"vue\";\nimport { ElTreeSelect } from \"element-plus\";\nimport { type SelectComponentProps, SelectProps } from \"@fast-element-plus/components/select/src/select\";\nimport { treeProps } from \"@fast-element-plus/components/tree/src/tree.props\";\nimport { addUnit, consoleError, definePropType, makeSlots, useExpose, useProps, useRender, withDefineType } from \"@fast-china/utils\";\nimport { useVModel } from \"@vueuse/core\";\nimport { isArray, isBoolean, isEqual, isFunction, isNil, isNull, isNumber, isObject, isString } from \"lodash-unified\";\nimport type { ElSelectorOutput } from \"@fast-element-plus/components/select\";\nimport type { FilterValue, NodeDropType, TreeKey, TreeNodeData } from \"@fast-element-plus/components/tree/src/tree.props\";\nimport type { ComponentInternalInstance, VNode } from \"vue\";\n\nexport const faTreeSelectProps = {\n\t...SelectProps,\n\t...treeProps,\n\t/** @description displayed text while loading data from server, default is 'Loading' */\n\tloadingText: {\n\t\ttype: String,\n\t\tdefault: \"加载中...\",\n\t},\n\t/** @description displayed text when no data matches the filtering query, you can also use slot `empty`, default is 'No matching data' */\n\tnoMatchText: {\n\t\ttype: String,\n\t\tdefault: \"暂无匹配的数据\",\n\t},\n\t/** @description displayed text when there is no options, you can also use slot `empty`, default is 'No data' */\n\tnoDataText: {\n\t\ttype: String,\n\t\tdefault: \"暂无数据\",\n\t},\n\t/** @description whether to collapse tags to a text when multiple selecting */\n\tcollapseTags: {\n\t\ttype: Boolean,\n\t\tdefault: true,\n\t},\n\t/** @description whether show all selected tags when mouse hover text of collapse-tags. To use this, `collapse-tags` must be true */\n\tcollapseTagsTooltip: {\n\t\ttype: Boolean,\n\t\tdefault: true,\n\t},\n\t/** 每个树节点用来作为唯一标识的属性,整棵树应该是唯一的 */\n\tnodeKey: {\n\t\ttype: String,\n\t\tdefault: \"value\",\n\t},\n\t/** @description 是否默认展开所有节点 */\n\tdefaultExpandAll: {\n\t\ttype: Boolean,\n\t\tdefault: true,\n\t},\n\t/** @description 是否在点击节点的时候选中节点 */\n\tcheckOnClickNode: {\n\t\ttype: Boolean,\n\t\tdefault: true,\n\t},\n\t/** @description 是否高亮当前选中节点 */\n\thighlightCurrent: {\n\t\ttype: Boolean,\n\t\tdefault: true,\n\t},\n\t/** @description 是否在点击节点的时候展开或者收缩节点, 默认值为 true,如果为 false,则只有点箭头图标的时候才会展开或者收缩节点。 */\n\texpandOnClickNode: Boolean,\n\t/** @description 点击折叠节点,需要开启 'expandOnClickNode' */\n\tcollapseOnClickNode: Boolean,\n\t/**\n\t * 懒加载节点的缓存数据,结构与数据相同,用于获取未加载数据的标签\n\t * @description The cached data of the lazy node, the structure is the same as the data, used to get the label of the unloaded data\n\t */\n\tcacheData: {\n\t\ttype: Array,\n\t\tdefault: (): [] => [],\n\t},\n\t/** @description v-model绑定值 */\n\tmodelValue: {\n\t\ttype: definePropType<string | number | boolean | object | (string | number | boolean | object)[]>([String, Number, Boolean, Object, Array]),\n\t\tdefault: undefined,\n\t},\n\t/** @description v-model:label绑定值 */\n\tlabel: definePropType<string | string[]>([String, Array]),\n\t/** @description 宽度 */\n\twidth: {\n\t\ttype: [String, Number],\n\t\tdefault: \"100%\",\n\t},\n\t/** @description 更多细节,只有使用slot的时候有用 */\n\tmoreDetail: Boolean,\n\t/** @description 懒加载远程数据,默认 true。当下拉框第一次显示的时候才会加载远程数据*/\n\tlazy: {\n\t\ttype: Boolean,\n\t\tdefault: true,\n\t},\n\t/** @description 默认选中。不能和懒加载一起使用 */\n\tdefaultSelected: Boolean,\n\t/** @description 配置选项 */\n\tprops: {\n\t\ttype: definePropType<SelectComponentProps>(Object),\n\t\tdefault: (): Partial<SelectComponentProps> => ({\n\t\t\tlabel: \"label\",\n\t\t\thide: \"hide\",\n\t\t\tdisabled: \"disabled\",\n\t\t\tchildren: \"children\",\n\t\t}),\n\t},\n\t/** @description 下拉框数据 */\n\tdata: {\n\t\ttype: definePropType<ElSelectorOutput[] | any[]>(Array),\n\t\tdefault: (): ElSelectorOutput[] | any[] => [],\n\t},\n\t/** @description 请求api */\n\trequestApi: {\n\t\ttype: definePropType<(params?: any) => Promise<ElSelectorOutput[] | any[]>>(Function),\n\t},\n\t/** 初始化参数 */\n\tinitParam: definePropType<string | number | any>([String, Number, Object]),\n};\n\nexport const faTreeSelectEmits = {\n\t/** @description v-model 回调 */\n\t\"update:modelValue\": (value: string | number | boolean | object | (string | number | boolean | object)[]): boolean =>\n\t\tisString(value) || isNumber(value) || isBoolean(value) || isObject(value) || isArray(value) || isNull(value),\n\t/** @description v-model:label 回调 */\n\t\"update:label\": (value: string | string[]): boolean => isString(value) || isArray(value) || isNull(value),\n\n\t/** @description 数据改变 */\n\tdataChangeCallBack: (data: ElSelectorOutput[] | any[]): boolean => isArray(data),\n\t/** @description 改变 */\n\tchange: (\n\t\tdata: ElSelectorOutput | ElSelectorOutput[] | any | any[],\n\t\tvalue?: string | number | boolean | object | (string | number | boolean | object)[]\n\t): boolean =>\n\t\t(isObject(data) || isArray(data) || isNull(data)) &&\n\t\t(isString(value) || isNumber(value) || isBoolean(value) || isObject(value) || isArray(value) || isNull(value)),\n\t/** @description 下拉框出现/隐藏时触发 */\n\tvisibleChange: (visible: boolean): boolean => isBoolean(visible),\n\t/** @description 多选模式下移除tag时触发 */\n\tremoveTag: (tagValue: any): boolean => isString(tagValue) || isNumber(tagValue) || isBoolean(tagValue) || isObject(tagValue) || isArray(tagValue),\n\t/** @description 可清空的单选模式下用户点击清空按钮时触发 */\n\tclear: (): boolean => true,\n\t/** @description 当 input 失去焦点时触发 */\n\tblur: (event: FocusEvent): boolean => event instanceof FocusEvent,\n\t/** @description 当 input 获得焦点时触发 */\n\tfocus: (event: FocusEvent): boolean => event instanceof FocusEvent,\n\n\t/** @description 当节点被点击的时候触发 */\n\tnodeClick: (data: ElSelectorOutput, node?: any, instance?: ComponentInternalInstance): boolean =>\n\t\tisObject(data) && isObject(node) && isObject(instance),\n\t/** @description 当某一节点被鼠标右键点击时会触发该事件 */\n\tnodeContextmenu: (event: Event, data: ElSelectorOutput, node?: any, instance?: ComponentInternalInstance): boolean =>\n\t\tevent instanceof Event && isObject(data) && isObject(node) && isObject(instance),\n\t/** @description 当复选框被点击的时候触发 */\n\tcheckChange: (data: ElSelectorOutput, checked: boolean, indeterminate: boolean): boolean =>\n\t\tisObject(data) && isBoolean(checked) && isBoolean(indeterminate),\n\t/** @description 点击节点复选框之后触发 */\n\tcheck: (\n\t\tdata: ElSelectorOutput,\n\t\tnode: {\n\t\t\tcheckedNodes: ElSelectorOutput[];\n\t\t\tcheckedKeys: TreeKey[];\n\t\t\thalfCheckedNodes: ElSelectorOutput[];\n\t\t\thalfCheckedKeys: TreeKey[];\n\t\t}\n\t): boolean => isObject(data) && isObject(node),\n\t/** @description 当前选中节点变化时触发的事件 */\n\tcurrentChange: (data: ElSelectorOutput, node: any): boolean => isObject(data) && isObject(node),\n\t/** @description 节点被展开时触发的事件 */\n\tnodeExpand: (data: ElSelectorOutput, node: any, instance: ComponentInternalInstance): boolean =>\n\t\tisObject(data) && isObject(node) && isObject(instance),\n\t/** @description 节点被关闭时触发的事件 */\n\tnodeCollapse: (data: ElSelectorOutput, node: any, instance: ComponentInternalInstance): boolean =>\n\t\tisObject(data) && isObject(node) && isObject(instance),\n\t/** @description 节点开始拖拽时触发的事件 */\n\tnodeDragStart: (node: any, event: DragEvent): boolean => isObject(node) && event instanceof DragEvent,\n\t/** @description 拖拽进入其他节点时触发的事件 */\n\tnodeDragEnter: (node: any, enterNode: any, event: DragEvent): boolean => isObject(node) && isObject(enterNode) && event instanceof DragEvent,\n\t/** @description 拖拽离开某个节点时触发的事件 */\n\tnodeDragLeave: (node: any, leaveNode: any, event: DragEvent): boolean => isObject(node) && isObject(leaveNode) && event instanceof DragEvent,\n\t/** @description 在拖拽节点时触发的事件(类似浏览器的 mouseover 事件) */\n\tnodeDragOver: (node: any, dropNode: any, event: DragEvent): boolean => isObject(node) && isObject(dropNode) && event instanceof DragEvent,\n\t/** @description 拖拽结束时(可能未成功)触发的事件 */\n\tnodeDragEnd: (node: any, dropNode: any, dropType: NodeDropType, event: DragEvent): boolean =>\n\t\tisObject(node) && isObject(dropNode) && isString(dropType) && event instanceof DragEvent,\n\t/** @description 拖拽成功完成时触发的事件 */\n\tnodeDrop: (node: any, dropNode: any, dropType: NodeDropType, event: DragEvent): boolean =>\n\t\tisObject(node) && isObject(dropNode) && isString(dropType) && event instanceof DragEvent,\n};\n\ntype FaTreeSelectSlots = {\n\t/** @description 默认内容插槽 */\n\tdefault: { node: any; data: ElSelectorOutput };\n\n\t/** @description 下拉列表顶部的内容 */\n\theader: never;\n\t/** @description 下拉列表底部的内容 */\n\tfooter: never;\n\t/** @description Select 组件头部内容 */\n\tprefix: never;\n\t/** @description 无选项时的列表 */\n\tempty: never;\n\t/** @description select 组件自定义标签内容 */\n\ttag: never;\n\t/** @description select 组件自定义 loading内容 */\n\tloading: never;\n\t/** @description select 组件自定义标签内容 */\n\tlabel: { label: string; value: string | number | boolean | object };\n};\n\nexport default defineComponent({\n\tname: \"FaTreeSelect\",\n\tprops: faTreeSelectProps,\n\temits: faTreeSelectEmits,\n\tslots: makeSlots<FaTreeSelectSlots>(),\n\tsetup(props, { attrs, slots, emit, expose }) {\n\t\tconst selectedLabel = useVModel(props, \"label\", emit, { passive: true });\n\n\t\tconst state = reactive({\n\t\t\tvalue: withDefineType<string | number | boolean | object | (string | number | boolean | object)[]>(),\n\t\t\tloading: false,\n\t\t\tselectorData: withDefineType<ElSelectorOutput[]>([]),\n\t\t\t/** 首次出现 */\n\t\t\tdebut: true,\n\t\t\t/** 回显 */\n\t\t\techo: props.data?.length > 0 ? false : true,\n\t\t\t/** 下次刷新 */\n\t\t\tnextRefresh: false,\n\t\t});\n\n\t\tconst treeSelectRef = ref<InstanceType<typeof ElTreeSelect>>();\n\n\t\tconst handleData = (data: ElSelectorOutput[] | any[]): ElSelectorOutput[] => {\n\t\t\treturn data\n\t\t\t\t?.map((m) => ({\n\t\t\t\t\t...m,\n\t\t\t\t\tvalue: m[props.nodeKey],\n\t\t\t\t\tlabel: isFunction(props.props.label) ? props.props.label(m) : m[props.props.label ?? \"label\"],\n\t\t\t\t\thide: isFunction(props.props.hide) ? props.props.hide(m) : m[props.props.hide ?? \"hide\"],\n\t\t\t\t\tdisabled: isFunction(props.props.disabled) ? props.props.disabled(m) : m[props.props.disabled ?? \"disabled\"],\n\t\t\t\t\tchildren: isFunction(props.props.children)\n\t\t\t\t\t\t? handleData(props.props.children(m))\n\t\t\t\t\t\t: handleData(m[props.props.children ?? \"children\"]),\n\t\t\t\t}))\n\t\t\t\t.filter((f) => !f.hide);\n\t\t};\n\n\t\tconst loadData = async (): Promise<void> => {\n\t\t\t// 判断是否需要自动请求\n\t\t\tif (props.requestApi) {\n\t\t\t\tstate.loading = true;\n\t\t\t\tconst params = props.initParam ?? {};\n\t\t\t\ttry {\n\t\t\t\t\tconst resData = await props.requestApi(params);\n\t\t\t\t\t// 这里不允许回显了\n\t\t\t\t\tstate.echo = false;\n\t\t\t\t\tstate.selectorData = handleData(resData);\n\t\t\t\t\temit(\"dataChangeCallBack\", state.selectorData);\n\t\t\t\t} catch (error) {\n\t\t\t\t\tconsoleError(\"FaTreeSelect\", error);\n\t\t\t\t\tstate.selectorData = [];\n\t\t\t\t} finally {\n\t\t\t\t\tstate.loading = false;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t// 这里不允许回显了\n\t\t\t\tstate.echo = false;\n\t\t\t\tstate.selectorData = handleData(props.data);\n\t\t\t}\n\t\t};\n\n\t\tconst handleFilterNode = (value: FilterValue, data: TreeNodeData, child: any): boolean => {\n\t\t\tif (!value) return true;\n\t\t\tlet parentNode = child.parent,\n\t\t\t\tlabels = [child.label],\n\t\t\t\tlevel = 1;\n\t\t\twhile (level < child.level) {\n\t\t\t\tlabels = [...labels, parentNode.label];\n\t\t\t\tparentNode = parentNode.parent;\n\t\t\t\tlevel++;\n\t\t\t}\n\t\t\tconst result = labels.some((label) => label.indexOf(value) !== -1);\n\t\t\tif (props.filterNodeMethod) {\n\t\t\t\treturn result && props.filterNodeMethod(value, data, child);\n\t\t\t}\n\t\t\treturn result;\n\t\t};\n\n\t\tconst handleChange = (value?: string | number | boolean | object | (string | number | boolean | object)[], data?: ElSelectorOutput): void => {\n\t\t\t// 判断是否为多选\n\t\t\tif (props.multiple) {\n\t\t\t\t// value 必然是数组\n\t\t\t\tconst valueArr = value as (string | number | boolean | object)[];\n\t\t\t\tif (valueArr?.length === 0) {\n\t\t\t\t\tstate.value = null;\n\t\t\t\t\tselectedLabel.value = null;\n\t\t\t\t\temit(\"update:modelValue\", null);\n\t\t\t\t\temit(\"change\", null, null);\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tconst dataList = state.selectorData.filter((f) => valueArr.includes(f.value));\n\t\t\t\tstate.value = value;\n\t\t\t\tselectedLabel.value = dataList.map((m) => m.label);\n\t\t\t\temit(\"update:modelValue\", value);\n\t\t\t\temit(\"change\", dataList, value);\n\t\t\t} else {\n\t\t\t\t// value 必然不是数组\n\t\t\t\tif (isNil(value)) {\n\t\t\t\t\tstate.value = null;\n\t\t\t\t\tselectedLabel.value = null;\n\t\t\t\t\temit(\"update:modelValue\", null);\n\t\t\t\t\temit(\"change\", null, null);\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tdata ??= state.selectorData.find((f) => f.value === value);\n\t\t\t\tstate.value = value;\n\t\t\t\tselectedLabel.value = data.label;\n\t\t\t\temit(\"update:modelValue\", value);\n\t\t\t\temit(\"change\", data, value);\n\t\t\t}\n\t\t};\n\n\t\tconst handleClear = (): void => {\n\t\t\tstate.value = null;\n\t\t\tselectedLabel.value = null;\n\t\t\temit(\"clear\");\n\t\t};\n\n\t\tconst handleNodeClick = (data: ElSelectorOutput, node: any, instance: ComponentInternalInstance, event: MouseEvent): void => {\n\t\t\t// 判断是否开启点击展开节点,并且节点是折叠状态,则自动展开,否则需要点击箭头图标才能折叠或开启 'collapseOnClickNode'\n\t\t\tif (props.expandOnClickNode) {\n\t\t\t\tif (!node.expanded) {\n\t\t\t\t\tnode.expand();\n\t\t\t\t} else if (node.expanded && props.collapseOnClickNode) {\n\t\t\t\t\tnode.collapse();\n\t\t\t\t}\n\t\t\t}\n\t\t\t// 判断是否开启了 checkStrictly\n\t\t\tif (props.checkStrictly) {\n\t\t\t\thandleChange(data.value, data);\n\t\t\t} else {\n\t\t\t\tif (node.isLeaf) {\n\t\t\t\t\thandleChange(data.value, data);\n\t\t\t\t}\n\t\t\t}\n\t\t\temit(\"nodeClick\", data, node, instance);\n\t\t};\n\n\t\t/**\n\t\t * 下拉框出现/隐藏时触发\n\t\t */\n\t\tconst handleVisibleChange = async (visible: boolean): Promise<void> => {\n\t\t\tif (visible) {\n\t\t\t\tif (state.debut) {\n\t\t\t\t\t// 首次出现\n\t\t\t\t\tstate.debut = false;\n\t\t\t\t\t// 懒加载\n\t\t\t\t\tprops.lazy && (await loadData());\n\t\t\t\t} else {\n\t\t\t\t\t// 判断再次出现是否需要刷新数据\n\t\t\t\t\tif (state.nextRefresh) {\n\t\t\t\t\t\tstate.nextRefresh = false;\n\t\t\t\t\t\tawait loadData();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\temit(\"visibleChange\", visible);\n\t\t};\n\n\t\twatch(\n\t\t\t() => props.modelValue,\n\t\t\t(newValue) => {\n\t\t\t\tif (state.echo && !isNil(newValue)) {\n\t\t\t\t\tconst hasLabel = !isNil(props.label);\n\t\t\t\t\t// 判断是否为多选\n\t\t\t\t\tif (props.multiple) {\n\t\t\t\t\t\t// 判断是否为数组\n\t\t\t\t\t\tif (!isArray(newValue)) {\n\t\t\t\t\t\t\tconsoleError(\"FaTreeSelect\", \"当启用 multiple 时,传入的 modelValue 必须是Array。\");\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (hasLabel && !isArray(props.label)) {\n\t\t\t\t\t\t\tconsoleError(\"FaTreeSelect\", \"当启用 multiple 时,传入的 modelValue:label 必须是Array。\");\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tstate.selectorData = newValue\n\t\t\t\t\t\t\t// 最大选项截取\n\t\t\t\t\t\t\t.slice(0, props.multipleLimit > 0 ? props.multipleLimit : newValue.length)\n\t\t\t\t\t\t\t.map((item, index) => ({\n\t\t\t\t\t\t\t\tvalue: item,\n\t\t\t\t\t\t\t\tlabel: hasLabel ? props.label[index] : undefined,\n\t\t\t\t\t\t\t}));\n\t\t\t\t\t} else {\n\t\t\t\t\t\tif (isArray(newValue)) {\n\t\t\t\t\t\t\tconsoleError(\"FaTreeSelect\", \"当禁用 multiple 时,传入的 modelValue 不能是Array。\");\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (hasLabel && isArray(props.label)) {\n\t\t\t\t\t\t\tconsoleError(\"FaTreeSelect\", \"当禁用 multiple 时,传入的 modelValue:label 不能是Array。\");\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tstate.selectorData = [\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tvalue: newValue,\n\t\t\t\t\t\t\t\tlabel: props.label,\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t];\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tstate.value = newValue;\n\t\t\t},\n\t\t\t{\n\t\t\t\timmediate: true,\n\t\t\t}\n\t\t);\n\n\t\tonMounted(async () => {\n\t\t\tif (props.defaultSelected) {\n\t\t\t\tawait loadData();\n\t\t\t\tif (state.selectorData.length > 0) {\n\t\t\t\t\tif (props.multiple) {\n\t\t\t\t\t\thandleChange([state.selectorData[0].value]);\n\t\t\t\t\t} else {\n\t\t\t\t\t\thandleChange(state.selectorData[0].value, state.selectorData[0]);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t// 判断是否为本地数据\n\t\t\telse if (!props.requestApi && props.data?.length > 0) {\n\t\t\t\tstate.debut = false;\n\t\t\t\tawait loadData();\n\t\t\t}\n\t\t\t// 判断是否非默认选中,且未启用懒加载\n\t\t\telse if (!props.lazy) {\n\t\t\t\tawait loadData();\n\t\t\t}\n\t\t\twatch(\n\t\t\t\t() => props.initParam,\n\t\t\t\t(newValue, oldValue) => {\n\t\t\t\t\tif (!isEqual(newValue, oldValue)) {\n\t\t\t\t\t\tstate.nextRefresh = true;\n\t\t\t\t\t\tif (!isNil(state.value)) {\n\t\t\t\t\t\t\thandleChange();\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t);\n\t\t\twatch(\n\t\t\t\t() => props.data,\n\t\t\t\tasync () => {\n\t\t\t\t\tif (!props.requestApi) {\n\t\t\t\t\t\tawait loadData();\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t\t{ deep: true }\n\t\t\t);\n\t\t});\n\n\t\tconst elTreeSelectProps = useProps(props, { ...SelectProps, ...treeProps }, [\n\t\t\t\"modelValue\",\n\t\t\t\"popperClass\",\n\t\t\t\"loading\",\n\t\t\t\"expandOnClickNode\",\n\t\t\t\"filterNodeMethod\",\n\t\t]);\n\n\t\tuseRender(() => (\n\t\t\t<ElTreeSelect\n\t\t\t\t{...elTreeSelectProps.value}\n\t\t\t\tref={treeSelectRef}\n\t\t\t\tclass=\"fa-tree-select\"\n\t\t\t\tpopperClass={`fa-tree-select-dropdown ${props.popperClass}`}\n\t\t\t\tstyle={{ width: addUnit(props.width) }}\n\t\t\t\tvModel={state.value}\n\t\t\t\tloading={state.loading}\n\t\t\t\tdata={state.selectorData}\n\t\t\t\texpandOnClickNode={props.checkOnClickNode ? false : props.expandOnClickNode}\n\t\t\t\tfilterNodeMethod={handleFilterNode}\n\t\t\t\tonNodeClick={handleNodeClick}\n\t\t\t\tonClear={handleClear}\n\t\t\t\tonVisibleChange={handleVisibleChange}\n\t\t\t\tonRemoveTag={(tagValue: any) => emit(\"removeTag\", tagValue)}\n\t\t\t\tonBlur={(event: FocusEvent) => emit(\"blur\", event)}\n\t\t\t\tonFocus={(event: FocusEvent) => emit(\"focus\", event)}\n\t\t\t\tonNodeContextmenu={(event: Event, data: ElSelectorOutput, node?: any, instance?: ComponentInternalInstance) =>\n\t\t\t\t\temit(\"nodeContextmenu\", event, data, node, instance)\n\t\t\t\t}\n\t\t\t\tonCheckChange={(data: ElSelectorOutput, checked: boolean, indeterminate: boolean) =>\n\t\t\t\t\temit(\"checkChange\", data, checked, indeterminate)\n\t\t\t\t}\n\t\t\t\tonCheck={(\n\t\t\t\t\tdata: ElSelectorOutput,\n\t\t\t\t\tnode: {\n\t\t\t\t\t\tcheckedNodes: ElSelectorOutput[];\n\t\t\t\t\t\tcheckedKeys: TreeKey[];\n\t\t\t\t\t\thalfCheckedNodes: ElSelectorOutput[];\n\t\t\t\t\t\thalfCheckedKeys: TreeKey[];\n\t\t\t\t\t}\n\t\t\t\t) => emit(\"check\", data, node)}\n\t\t\t\tonCurrentChange={(data: ElSelectorOutput, node: any) => emit(\"currentChange\", data, node)}\n\t\t\t\tonNodeExpand={(data: ElSelectorOutput, node: any, instance: ComponentInternalInstance) => emit(\"nodeExpand\", data, node, instance)}\n\t\t\t\tonNodeCollapse={(data: ElSelectorOutput, node: any, instance: ComponentInternalInstance) =>\n\t\t\t\t\temit(\"nodeCollapse\", data, node, instance)\n\t\t\t\t}\n\t\t\t\tonNodeDragStart={(node: any, event: DragEvent) => emit(\"nodeDragStart\", node, event)}\n\t\t\t\tonNodeDragEnter={(node: any, enterNode: any, event: DragEvent) => emit(\"nodeDragEnter\", node, enterNode, event)}\n\t\t\t\tonNodeDragLeave={(node: any, leaveNode: any, event: DragEvent) => emit(\"nodeDragLeave\", node, leaveNode, event)}\n\t\t\t\tonNodeDragOver={(node: any, dropNode: any, event: DragEvent) => emit(\"nodeDragOver\", node, dropNode, event)}\n\t\t\t\tonNodeDragEnd={(node: any, dropNode: any, dropType: NodeDropType, event: DragEvent) =>\n\t\t\t\t\temit(\"nodeDragEnd\", node, dropNode, dropType, event)\n\t\t\t\t}\n\t\t\t\tonNodeDrop={(node: any, dropNode: any, dropType: NodeDropType, event: DragEvent) => emit(\"nodeDrop\", node, dropNode, dropType, event)}\n\t\t\t>\n\t\t\t\t{{\n\t\t\t\t\t...(slots.default && {\n\t\t\t\t\t\tdefault: ({ node, data }: { node: any; data: ElSelectorOutput }): VNode[] => slots.default({ node, data }),\n\t\t\t\t\t}),\n\t\t\t\t\t...(slots.header && { header: (): VNode[] => slots.header() }),\n\t\t\t\t\t...(slots.footer && { footer: (): VNode[] => slots.footer() }),\n\t\t\t\t\t...(slots.prefix && { prefix: (): VNode[] => slots.prefix() }),\n\t\t\t\t\t...(slots.empty && { empty: (): VNode[] => slots.empty() }),\n\t\t\t\t\t...(slots.tag && { tag: (): VNode[] => slots.tag() }),\n\t\t\t\t\t...(slots.loading && { loading: (): VNode[] => slots.loading() }),\n\t\t\t\t\t...(slots.label && {\n\t\t\t\t\t\tlabel: ({ label, value }: { label: string; value: string | number | boolean | object }): VNode[] =>\n\t\t\t\t\t\t\tslots.label({ label, value }),\n\t\t\t\t\t}),\n\t\t\t\t}}\n\t\t\t</ElTreeSelect>\n\t\t));\n\n\t\treturn useExpose(expose, {\n\t\t\t/** @description 使选择器的输入框获取焦点 */\n\t\t\tfocus: computed(() => treeSelectRef.value?.focus),\n\t\t\t/** @description 使选择器的输入框失去焦点,并隐藏下拉框 */\n\t\t\tblur: computed(() => treeSelectRef.value?.blur),\n\t\t\t/** @description 获取当前选中的标签 */\n\t\t\tselectedLabel: computed(() => treeSelectRef.value?.selectedLabel),\n\n\t\t\t/** @description 过滤所有树节点,过滤后的节点将被隐藏 */\n\t\t\tfilter: computed(() => treeSelectRef.value?.filter),\n\t\t\t/** @description 为节点设置新数据,只有当设置 node-key 属性的时候才可用 */\n\t\t\tupdateKeyChildren: computed(() => treeSelectRef.value?.updateKeyChildren),\n\t\t\t/** @description 如果节点可以被选中,(show-checkbox 为 true), 本方法将返回当前选中节点的数组 */\n\t\t\tgetCheckedNodes: computed(() => treeSelectRef.value?.getCheckedNodes),\n\t\t\t/** @description 设置目前勾选的节点,使用此方法必须提前设置 node-key 属性 */\n\t\t\tsetCheckedNodes: computed(() => treeSelectRef.value?.setCheckedNodes),\n\t\t\t/** @description 若节点可用被选中 (show-checkbox 为 true), 它将返回当前选中节点 key 的数组 */\n\t\t\tgetCheckedKeys: computed(() => treeSelectRef.value?.getCheckedKeys),\n\t\t\t/** @description 设置目前选中的节点,使用此方法必须设置 node-key 属性 */\n\t\t\tsetCheckedKeys: computed(() => treeSelectRef.value?.setCheckedKeys),\n\t\t\t/** @description 设置节点是否被选中, 使用此方法必须设置 node-key 属性 */\n\t\t\tsetChecked: computed(() => treeSelectRef.value?.setChecked),\n\t\t\t/** @description 如果节点可用被选中 (show-checkbox 为 true), 它将返回当前半选中的节点组成的数组 */\n\t\t\tgetHalfCheckedNodes: computed(() => treeSelectRef.value?.getHalfCheckedNodes),\n\t\t\t/** @description 若节点可被选中(show-checkbox 为 true),则返回目前半选中的节点的 key 所组成的数组 */\n\t\t\tgetHalfCheckedKeys: computed(() => treeSelectRef.value?.getHalfCheckedKeys),\n\t\t\t/** @description 返回当前被选中节点的数据 (如果没有则返回 null) */\n\t\t\tgetCurrentKey: computed(() => treeSelectRef.value?.getCurrentKey),\n\t\t\t/** @description 返回当前被选中节点的数据 (如果没有则返回 null) */\n\t\t\tgetCurrentNode: computed(() => treeSelectRef.value?.getCurrentNode),\n\t\t\t/** @description 通过 key 设置某个节点的当前选中状态,使用此方法必须设置 node-key 属性 */\n\t\t\tsetCurrentKey: computed(() => treeSelectRef.value?.setCurrentKey),\n\t\t\t/** @description 设置节点为选中状态,使用此方法必须设置 node-key 属性 */\n\t\t\tsetCurrentNode: computed(() => treeSelectRef.value?.setCurrentNode),\n\t\t\t/** @description 根据 data 或者 key 拿到 Tree 组件中的 node */\n\t\t\tgetNode: computed(() => treeSelectRef.value?.getNode),\n\t\t\t/** @description 删除 Tree 中的一个节点,使用此方法必须设置 node-key 属性 */\n\t\t\tremove: computed(() => treeSelectRef.value?.remove),\n\t\t\t/** @description 为 Tree 中的一个节点追加一个子节点 */\n\t\t\tappend: computed(() => treeSelectRef.value?.append),\n\t\t\t/** @description 在 Tree 中给定节点前插入一个节点 */\n\t\t\tinsertBefore: computed(() => treeSelectRef.value?.insertBefore),\n\t\t\t/** @description 在 Tree 中给定节点后插入一个节点 */\n\t\t\tinsertAfter: computed(() => treeSelectRef.value?.insertAfter),\n\t\t\t/** @description 加载状态 */\n\t\t\tloading: computed(() => state.loading),\n\t\t\t/** @description 刷新 */\n\t\t\trefresh: loadData,\n\t\t\t/** @description 设置选择 */\n\t\t\tsetSelection: (value: string | number | boolean | object | (string | number | boolean | object)[]) => handleChange(value),\n\t\t\t/** @description 清除选择 */\n\t\t\tclearSelection: () => handleChange(null),\n\t\t});\n\t},\n});\n"],"names":["faTreeSelectProps","SelectProps","treeProps","loadingText","type","String","default","noMatchText","noDataText","collapseTags","Boolean","collapseTagsTooltip","nodeKey","defaultExpandAll","checkOnClickNode","highlightCurrent","expandOnClickNode","collapseOnClickNode","cacheData","Array","modelValue","definePropType","Number","Object","undefined","label","width","moreDetail","lazy","defaultSelected","props","hide","disabled","children","data","requestApi","Function","initParam","faTreeSelectEmits","value","isString","isNumber","isBoolean","isObject","isArray","isNull","dataChangeCallBack","change","visibleChange","visible","removeTag","tagValue","clear","blur","event","FocusEvent","focus","nodeClick","node","instance","nodeContextmenu","Event","checkChange","checked","indeterminate","check","currentChange","nodeExpand","nodeCollapse","nodeDragStart","DragEvent","nodeDragEnter","enterNode","nodeDragLeave","leaveNode","nodeDragOver","dropNode","nodeDragEnd","dropType","nodeDrop","TreeSelect","name","emits","slots","makeSlots","setup","attrs","emit","expose","selectedLabel","useVModel","passive","state","reactive","withDefineType","loading","selectorData","debut","echo","length","nextRefresh","treeSelectRef","ref","handleData","map","m","isFunction","filter","f","loadData","async","params","resData","error","consoleError","handleFilterNode","child","parentNode","parent","labels","level","result","some","indexOf","filterNodeMethod","handleChange","multiple","valueArr","dataList","includes","isNil","find","handleClear","handleNodeClick","expanded","collapse","expand","checkStrictly","isLeaf","handleVisibleChange","watch","newValue","hasLabel","slice","multipleLimit","item","index","immediate","onMounted","oldValue","isEqual","deep","elTreeSelectProps","useProps","useRender","_createVNode","ElTreeSelect","_mergeProps","class","popperClass","style","addUnit","$event","onNodeClick","onClear","onVisibleChange","onRemoveTag","onBlur","onFocus","onNodeContextmenu","onCheckChange","onCheck","onCurrentChange","onNodeExpand","onNodeCollapse","onNodeDragStart","onNodeDragEnter","onNodeDragLeave","onNodeDragOver","onNodeDragEnd","onNodeDrop","header","footer","prefix","empty","tag","useExpose","computed","updateKeyChildren","getCheckedNodes","setCheckedNodes","getCheckedKeys","setCheckedKeys","setChecked","getHalfCheckedNodes","getHalfCheckedKeys","getCurrentKey","getCurrentNode","setCurrentKey","setCurrentNode","getNode","remove","append","insertBefore","insertAfter","refresh","setSelection","clearSelection"],"mappings":"soBAWO,MAAMA,EAAoB,IAC7BC,KACAC,EAEHC,YAAa,CACZC,KAAMC,OACNC,QAAS,UAGVC,YAAa,CACZH,KAAMC,OACNC,QAAS,WAGVE,WAAY,CACXJ,KAAMC,OACNC,QAAS,QAGVG,aAAc,CACbL,KAAMM,QACNJ,SAAS,GAGVK,oBAAqB,CACpBP,KAAMM,QACNJ,SAAS,GAGVM,QAAS,CACRR,KAAMC,OACNC,QAAS,SAGVO,iBAAkB,CACjBT,KAAMM,QACNJ,SAAS,GAGVQ,iBAAkB,CACjBV,KAAMM,QACNJ,SAAS,GAGVS,iBAAkB,CACjBX,KAAMM,QACNJ,SAAS,GAGVU,kBAAmBN,QAEnBO,oBAAqBP,QAKrBQ,UAAW,CACVd,KAAMe,MACNb,QAASA,IAAU,IAGpBc,WAAY,CACXhB,KAAMiB,EAA4F,CAAChB,OAAQiB,OAAQZ,QAASa,OAAQJ,QACpIb,aAASkB,GAGVC,MAAOJ,EAAkC,CAAChB,OAAQc,QAElDO,MAAO,CACNtB,KAAM,CAACC,OAAQiB,QACfhB,QAAS,QAGVqB,WAAYjB,QAEZkB,KAAM,CACLxB,KAAMM,QACNJ,SAAS,GAGVuB,gBAAiBnB,QAEjBoB,MAAO,CACN1B,KAAMiB,EAAqCE,QAC3CjB,QAASA,KAAAA,CACRmB,MAAO,QACPM,KAAM,OACNC,SAAU,WACVC,SAAU,cAIZC,KAAM,CACL9B,KAAMiB,EAA2CF,OACjDb,QAASA,IAAkC,IAG5C6B,WAAY,CACX/B,KAAMiB,EAAsEe,WAG7EC,UAAWhB,EAAsC,CAAChB,O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EAAS,IAAMtF,EAAc9D,OAAOgK,gBAEpDC,QAASb,EAAS,IAAMtF,EAAc9D,OAAOiK,SAE7CC,OAAQd,EAAS,IAAMtF,EAAc9D,OAAOkK,QAE5CC,OAAQf,EAAS,IAAMtF,EAAc9D,OAAOmK,QAE5CC,aAAchB,EAAS,IAAMtF,EAAc9D,OAAOoK,cAElDC,YAAajB,EAAS,IAAMtF,EAAc9D,OAAOqK,aAEjD7G,QAAS4F,EAAS,IAAM/F,EAAMG,SAE9B8G,QAAShG,EAETiG,aAAevK,GAAuFsF,EAAatF,GAEnHwK,eAAgBA,IAAMlF,EAAa,OAErC"}
|
|
1
|
+
{"version":3,"file":"treeSelect.mjs","sources":["../../../../../packages/components/treeSelect/src/treeSelect.tsx"],"sourcesContent":["import { computed, defineComponent, onMounted, reactive, ref, watch } from \"vue\";\nimport { ElTreeSelect, selectEmits, treeEmits } from \"element-plus\";\nimport { type SelectComponentProps, SelectProps } from \"@fast-element-plus/components/select/src/select\";\nimport { treeProps } from \"@fast-element-plus/components/tree/src/tree.props\";\nimport { addUnit, consoleError, definePropType, makeSlots, useEmits, useExpose, useProps, useRender, withDefineType } from \"@fast-china/utils\";\nimport { useVModel } from \"@vueuse/core\";\nimport { isArray, isBoolean, isEqual, isFunction, isNil, isNull, isNumber, isObject, isString } from \"lodash-unified\";\nimport type { ElSelectorOutput } from \"@fast-element-plus/components/select\";\nimport type { FilterValue, TreeNodeData } from \"@fast-element-plus/components/tree/src/tree.props\";\nimport type { ComponentInternalInstance, VNode } from \"vue\";\n\nexport const faTreeSelectProps = {\n\t...SelectProps,\n\t...treeProps,\n\t/** @description whether Select is disabled 重载使其支持 ElForm*/\n\tdisabled: {\n\t\ttype: Boolean,\n\t\tdefault: undefined,\n\t},\n\t/** @description displayed text while loading data from server, default is 'Loading' */\n\tloadingText: {\n\t\ttype: String,\n\t\tdefault: \"加载中...\",\n\t},\n\t/** @description displayed text when no data matches the filtering query, you can also use slot `empty`, default is 'No matching data' */\n\tnoMatchText: {\n\t\ttype: String,\n\t\tdefault: \"暂无匹配的数据\",\n\t},\n\t/** @description displayed text when there is no options, you can also use slot `empty`, default is 'No data' */\n\tnoDataText: {\n\t\ttype: String,\n\t\tdefault: \"暂无数据\",\n\t},\n\t/** @description whether to collapse tags to a text when multiple selecting */\n\tcollapseTags: {\n\t\ttype: Boolean,\n\t\tdefault: true,\n\t},\n\t/** @description whether show all selected tags when mouse hover text of collapse-tags. To use this, `collapse-tags` must be true */\n\tcollapseTagsTooltip: {\n\t\ttype: Boolean,\n\t\tdefault: true,\n\t},\n\t/** 每个树节点用来作为唯一标识的属性,整棵树应该是唯一的 */\n\tnodeKey: {\n\t\ttype: String,\n\t\tdefault: \"value\",\n\t},\n\t/** @description 是否默认展开所有节点 */\n\tdefaultExpandAll: {\n\t\ttype: Boolean,\n\t\tdefault: true,\n\t},\n\t/** @description 是否在点击节点的时候选中节点 */\n\tcheckOnClickNode: {\n\t\ttype: Boolean,\n\t\tdefault: true,\n\t},\n\t/** @description 是否高亮当前选中节点 */\n\thighlightCurrent: {\n\t\ttype: Boolean,\n\t\tdefault: true,\n\t},\n\t/** @description 是否在点击节点的时候展开或者收缩节点, 默认值为 true,如果为 false,则只有点箭头图标的时候才会展开或者收缩节点。 */\n\texpandOnClickNode: Boolean,\n\t/** @description 点击折叠节点,需要开启 'expandOnClickNode' */\n\tcollapseOnClickNode: Boolean,\n\t/**\n\t * 懒加载节点的缓存数据,结构与数据相同,用于获取未加载数据的标签\n\t * @description The cached data of the lazy node, the structure is the same as the data, used to get the label of the unloaded data\n\t */\n\tcacheData: {\n\t\ttype: definePropType<\n\t\t\t{\n\t\t\t\tvalue: string | number | boolean | object;\n\t\t\t\tcurrentLabel: string | number;\n\t\t\t\tisDisabled: boolean;\n\t\t\t}[]\n\t\t>(Array),\n\t\tdefault: [] as {\n\t\t\tvalue: string | number | boolean | object;\n\t\t\tcurrentLabel: string | number;\n\t\t\tisDisabled: boolean;\n\t\t}[],\n\t},\n\t/** @description v-model绑定值 */\n\tmodelValue: {\n\t\ttype: definePropType<string | number | boolean | object | (string | number | boolean | object)[]>([String, Number, Boolean, Object, Array]),\n\t\tdefault: undefined,\n\t},\n\t/** @description v-model:label绑定值 */\n\tlabel: definePropType<string | string[]>([String, Array]),\n\t/** @description 宽度 */\n\twidth: {\n\t\ttype: [String, Number],\n\t\tdefault: \"100%\",\n\t},\n\t/** @description 更多细节,只有使用slot的时候有用 */\n\tmoreDetail: Boolean,\n\t/** @description 懒加载远程数据,默认 true。当下拉框第一次显示的时候才会加载远程数据*/\n\tlazy: {\n\t\ttype: Boolean,\n\t\tdefault: true,\n\t},\n\t/** @description 默认选中。不能和懒加载一起使用 */\n\tdefaultSelected: Boolean,\n\t/** @description 配置选项 */\n\tprops: {\n\t\ttype: definePropType<SelectComponentProps>(Object),\n\t\tdefault: (): Partial<SelectComponentProps> => ({\n\t\t\tlabel: \"label\",\n\t\t\thide: \"hide\",\n\t\t\tdisabled: \"disabled\",\n\t\t\tchildren: \"children\",\n\t\t}),\n\t},\n\t/** @description 下拉框数据 */\n\tdata: {\n\t\ttype: definePropType<ElSelectorOutput[] | any[]>(Array),\n\t\tdefault: (): ElSelectorOutput[] | any[] => [],\n\t},\n\t/** @description 请求api */\n\trequestApi: {\n\t\ttype: definePropType<(params?: any) => Promise<ElSelectorOutput[] | any[]>>(Function),\n\t},\n\t/** 初始化参数 */\n\tinitParam: definePropType<string | number | any>([String, Number, Object]),\n};\n\nexport const faTreeSelectEmits = {\n\t...selectEmits,\n\t...treeEmits,\n\t/** @description v-model 回调 */\n\t\"update:modelValue\": (value: string | number | boolean | object | (string | number | boolean | object)[]): boolean =>\n\t\tisString(value) || isNumber(value) || isBoolean(value) || isObject(value) || isArray(value) || isNull(value),\n\t/** @description v-model:label 回调 */\n\t\"update:label\": (value: string | string[]): boolean => isString(value) || isArray(value) || isNull(value),\n\n\t/** @description 数据改变 */\n\tdataChangeCallBack: (data: ElSelectorOutput[] | any[]): boolean => isArray(data),\n\t/** @description 改变 */\n\tchange: (\n\t\tdata: ElSelectorOutput | ElSelectorOutput[] | any | any[],\n\t\tvalue?: string | number | boolean | object | (string | number | boolean | object)[]\n\t): boolean => true,\n};\n\ntype FaTreeSelectSlots = {\n\t/** @description 默认内容插槽 */\n\tdefault: { node: any; data: ElSelectorOutput };\n\n\t/** @description 下拉列表顶部的内容 */\n\theader: never;\n\t/** @description 下拉列表底部的内容 */\n\tfooter: never;\n\t/** @description Select 组件头部内容 */\n\tprefix: never;\n\t/** @description 无选项时的列表 */\n\tempty: never;\n\t/** @description select 组件自定义标签内容 */\n\ttag: never;\n\t/** @description select 组件自定义 loading内容 */\n\tloading: never;\n\t/** @description select 组件自定义标签内容 */\n\tlabel: { label: string; value: string | number | boolean | object };\n};\n\nexport default defineComponent({\n\tname: \"FaTreeSelect\",\n\tprops: faTreeSelectProps,\n\temits: faTreeSelectEmits,\n\tslots: makeSlots<FaTreeSelectSlots>(),\n\tsetup(props, { attrs, slots, emit, expose }) {\n\t\tconst selectedLabel = useVModel(props, \"label\", emit);\n\n\t\tconst state = reactive({\n\t\t\tvalue: withDefineType<string | number | boolean | object | (string | number | boolean | object)[]>(),\n\t\t\tloading: false,\n\t\t\tselectorData: withDefineType<ElSelectorOutput[]>([]),\n\t\t\t/** 首次出现 */\n\t\t\tdebut: true,\n\t\t\t/** 回显 */\n\t\t\techo: props.data?.length > 0 ? false : true,\n\t\t\t/** 下次刷新 */\n\t\t\tnextRefresh: false,\n\t\t});\n\n\t\tconst treeSelectRef = ref<InstanceType<typeof ElTreeSelect>>();\n\n\t\tconst handleData = (data: ElSelectorOutput[] | any[]): ElSelectorOutput[] => {\n\t\t\treturn data\n\t\t\t\t?.map((m) => ({\n\t\t\t\t\t...m,\n\t\t\t\t\tvalue: m[props.nodeKey],\n\t\t\t\t\tlabel: isFunction(props.props.label) ? props.props.label(m) : m[props.props.label ?? \"label\"],\n\t\t\t\t\thide: isFunction(props.props.hide) ? props.props.hide(m) : m[props.props.hide ?? \"hide\"],\n\t\t\t\t\tdisabled: isFunction(props.props.disabled) ? props.props.disabled(m) : m[props.props.disabled ?? \"disabled\"],\n\t\t\t\t\tchildren: isFunction(props.props.children)\n\t\t\t\t\t\t? handleData(props.props.children(m))\n\t\t\t\t\t\t: handleData(m[props.props.children ?? \"children\"]),\n\t\t\t\t}))\n\t\t\t\t.filter((f) => !f.hide);\n\t\t};\n\n\t\tconst loadData = async (): Promise<void> => {\n\t\t\t// 判断是否需要自动请求\n\t\t\tif (props.requestApi) {\n\t\t\t\tstate.loading = true;\n\t\t\t\tconst params = props.initParam ?? {};\n\t\t\t\ttry {\n\t\t\t\t\tconst resData = await props.requestApi(params);\n\t\t\t\t\t// 这里不允许回显了\n\t\t\t\t\tstate.echo = false;\n\t\t\t\t\tstate.selectorData = handleData(resData);\n\t\t\t\t\temit(\"dataChangeCallBack\", state.selectorData);\n\t\t\t\t} catch (error) {\n\t\t\t\t\tconsoleError(\"FaTreeSelect\", error);\n\t\t\t\t\tstate.selectorData = [];\n\t\t\t\t} finally {\n\t\t\t\t\tstate.loading = false;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t// 这里不允许回显了\n\t\t\t\tstate.echo = false;\n\t\t\t\tstate.selectorData = handleData(props.data);\n\t\t\t}\n\t\t};\n\n\t\tconst handleFilterNode = (value: FilterValue, data: TreeNodeData, child: any): boolean => {\n\t\t\tif (!value) return true;\n\t\t\tlet parentNode = child.parent,\n\t\t\t\tlabels = [child.label],\n\t\t\t\tlevel = 1;\n\t\t\twhile (level < child.level) {\n\t\t\t\tlabels = [...labels, parentNode.label];\n\t\t\t\tparentNode = parentNode.parent;\n\t\t\t\tlevel++;\n\t\t\t}\n\t\t\tconst result = labels.some((label) => label.indexOf(value) !== -1);\n\t\t\tif (props.filterNodeMethod) {\n\t\t\t\treturn result && props.filterNodeMethod(value, data, child);\n\t\t\t}\n\t\t\treturn result;\n\t\t};\n\n\t\tconst handleChange = (value?: string | number | boolean | object | (string | number | boolean | object)[], data?: ElSelectorOutput): void => {\n\t\t\t// 判断是否为多选\n\t\t\tif (props.multiple) {\n\t\t\t\t// value 必然是数组\n\t\t\t\tconst valueArr = value as (string | number | boolean | object)[];\n\t\t\t\tif (valueArr?.length === 0) {\n\t\t\t\t\tstate.value = null;\n\t\t\t\t\tselectedLabel.value = null;\n\t\t\t\t\temit(\"update:modelValue\", null);\n\t\t\t\t\temit(\"change\", null, null);\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tconst dataList = state.selectorData.filter((f) => valueArr.includes(f.value));\n\t\t\t\tstate.value = value;\n\t\t\t\tselectedLabel.value = dataList.map((m) => m.label);\n\t\t\t\temit(\"update:modelValue\", value);\n\t\t\t\temit(\"change\", dataList, value);\n\t\t\t} else {\n\t\t\t\t// value 必然不是数组\n\t\t\t\tif (isNil(value)) {\n\t\t\t\t\tstate.value = null;\n\t\t\t\t\tselectedLabel.value = null;\n\t\t\t\t\temit(\"update:modelValue\", null);\n\t\t\t\t\temit(\"change\", null, null);\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tdata ??= state.selectorData.find((f) => f.value === value);\n\t\t\t\tstate.value = value;\n\t\t\t\tselectedLabel.value = data.label;\n\t\t\t\temit(\"update:modelValue\", value);\n\t\t\t\temit(\"change\", data, value);\n\t\t\t}\n\t\t};\n\n\t\tconst handleClear = (): void => {\n\t\t\tstate.value = null;\n\t\t\tselectedLabel.value = null;\n\t\t\temit(\"update:modelValue\", null);\n\t\t\temit(\"clear\");\n\t\t};\n\n\t\tconst handleNodeClick = (data: ElSelectorOutput, node: any, instance: ComponentInternalInstance, event: MouseEvent): void => {\n\t\t\t// 判断是否开启点击展开节点,并且节点是折叠状态,则自动展开,否则需要点击箭头图标才能折叠或开启 'collapseOnClickNode'\n\t\t\tif (props.expandOnClickNode) {\n\t\t\t\tif (!node.expanded) {\n\t\t\t\t\tnode.expand();\n\t\t\t\t} else if (node.expanded && props.collapseOnClickNode) {\n\t\t\t\t\tnode.collapse();\n\t\t\t\t}\n\t\t\t}\n\t\t\t// 判断是否开启了 checkStrictly\n\t\t\tif (props.checkStrictly) {\n\t\t\t\thandleChange(data.value, data);\n\t\t\t} else {\n\t\t\t\tif (node.isLeaf) {\n\t\t\t\t\thandleChange(data.value, data);\n\t\t\t\t}\n\t\t\t}\n\t\t\temit(\"node-click\", data, node, instance, event);\n\t\t};\n\n\t\t/**\n\t\t * 下拉框出现/隐藏时触发\n\t\t */\n\t\tconst handleVisibleChange = async (visible: boolean): Promise<void> => {\n\t\t\tif (visible) {\n\t\t\t\tif (state.debut) {\n\t\t\t\t\t// 首次出现\n\t\t\t\t\tstate.debut = false;\n\t\t\t\t\t// 懒加载\n\t\t\t\t\tprops.lazy && (await loadData());\n\t\t\t\t} else {\n\t\t\t\t\t// 判断再次出现是否需要刷新数据\n\t\t\t\t\tif (state.nextRefresh) {\n\t\t\t\t\t\tstate.nextRefresh = false;\n\t\t\t\t\t\tawait loadData();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\temit(\"visible-change\", visible);\n\t\t};\n\n\t\twatch(\n\t\t\t() => props.modelValue,\n\t\t\t(newValue) => {\n\t\t\t\tif (state.echo && !isNil(newValue)) {\n\t\t\t\t\tconst hasLabel = !isNil(props.label);\n\t\t\t\t\t// 判断是否为多选\n\t\t\t\t\tif (props.multiple) {\n\t\t\t\t\t\t// 判断是否为数组\n\t\t\t\t\t\tif (!isArray(newValue)) {\n\t\t\t\t\t\t\tconsoleError(\"FaTreeSelect\", \"当启用 multiple 时,传入的 modelValue 必须是Array。\");\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (hasLabel && !isArray(props.label)) {\n\t\t\t\t\t\t\tconsoleError(\"FaTreeSelect\", \"当启用 multiple 时,传入的 modelValue:label 必须是Array。\");\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tstate.selectorData = newValue\n\t\t\t\t\t\t\t// 最大选项截取\n\t\t\t\t\t\t\t.slice(0, props.multipleLimit > 0 ? props.multipleLimit : newValue.length)\n\t\t\t\t\t\t\t.map((item, index) => ({\n\t\t\t\t\t\t\t\tvalue: item,\n\t\t\t\t\t\t\t\tlabel: hasLabel ? props.label[index] : undefined,\n\t\t\t\t\t\t\t}));\n\t\t\t\t\t} else {\n\t\t\t\t\t\tif (isArray(newValue)) {\n\t\t\t\t\t\t\tconsoleError(\"FaTreeSelect\", \"当禁用 multiple 时,传入的 modelValue 不能是Array。\");\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (hasLabel && isArray(props.label)) {\n\t\t\t\t\t\t\tconsoleError(\"FaTreeSelect\", \"当禁用 multiple 时,传入的 modelValue:label 不能是Array。\");\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tstate.selectorData = [\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tvalue: newValue,\n\t\t\t\t\t\t\t\tlabel: props.label,\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t];\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tstate.value = newValue;\n\t\t\t},\n\t\t\t{\n\t\t\t\timmediate: true,\n\t\t\t}\n\t\t);\n\n\t\tonMounted(async () => {\n\t\t\tif (props.defaultSelected) {\n\t\t\t\tawait loadData();\n\t\t\t\tif (state.selectorData.length > 0) {\n\t\t\t\t\tif (props.multiple) {\n\t\t\t\t\t\thandleChange([state.selectorData[0].value]);\n\t\t\t\t\t} else {\n\t\t\t\t\t\thandleChange(state.selectorData[0].value, state.selectorData[0]);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t// 判断是否为本地数据\n\t\t\telse if (!props.requestApi && props.data?.length > 0) {\n\t\t\t\tstate.debut = false;\n\t\t\t\tawait loadData();\n\t\t\t}\n\t\t\t// 判断是否非默认选中,且未启用懒加载\n\t\t\telse if (!props.lazy) {\n\t\t\t\tawait loadData();\n\t\t\t}\n\t\t\twatch(\n\t\t\t\t() => props.initParam,\n\t\t\t\t(newValue, oldValue) => {\n\t\t\t\t\tif (!isEqual(newValue, oldValue)) {\n\t\t\t\t\t\tstate.nextRefresh = true;\n\t\t\t\t\t\tif (!isNil(state.value)) {\n\t\t\t\t\t\t\thandleChange();\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t);\n\t\t\twatch(\n\t\t\t\t() => props.data,\n\t\t\t\tasync () => {\n\t\t\t\t\tif (!props.requestApi) {\n\t\t\t\t\t\tawait loadData();\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t\t{ deep: true }\n\t\t\t);\n\t\t});\n\n\t\tconst elTreeSelectProps = useProps(props, { ...SelectProps, ...treeProps }, [\n\t\t\t\"modelValue\",\n\t\t\t\"popperClass\",\n\t\t\t\"loading\",\n\t\t\t\"expandOnClickNode\",\n\t\t\t\"filterNodeMethod\",\n\t\t]);\n\t\tconst elTreeSelectEmits = useEmits({ ...selectEmits, ...treeEmits }, emit, [\"update:modelValue\", \"clear\", \"visible-change\", \"node-click\"]);\n\n\t\tuseRender(() => (\n\t\t\t<ElTreeSelect\n\t\t\t\t{...elTreeSelectProps.value}\n\t\t\t\t{...elTreeSelectEmits.value}\n\t\t\t\tref={treeSelectRef}\n\t\t\t\tclass=\"fa-tree-select\"\n\t\t\t\tpopperClass={`fa-tree-select-dropdown ${props.popperClass}`}\n\t\t\t\tstyle={{ width: addUnit(props.width) }}\n\t\t\t\tvModel={state.value}\n\t\t\t\tloading={state.loading}\n\t\t\t\tdata={state.selectorData}\n\t\t\t\texpandOnClickNode={props.checkOnClickNode ? false : props.expandOnClickNode}\n\t\t\t\tfilterNodeMethod={handleFilterNode}\n\t\t\t\tonNodeClick={handleNodeClick}\n\t\t\t\tonClear={handleClear}\n\t\t\t\tonVisibleChange={handleVisibleChange}\n\t\t\t>\n\t\t\t\t{{\n\t\t\t\t\t...(slots.default && {\n\t\t\t\t\t\tdefault: ({ node, data }: { node: any; data: ElSelectorOutput }): VNode[] => slots.default({ node, data }),\n\t\t\t\t\t}),\n\t\t\t\t\t...(slots.header && { header: (): VNode[] => slots.header() }),\n\t\t\t\t\t...(slots.footer && { footer: (): VNode[] => slots.footer() }),\n\t\t\t\t\t...(slots.prefix && { prefix: (): VNode[] => slots.prefix() }),\n\t\t\t\t\t...(slots.empty && { empty: (): VNode[] => slots.empty() }),\n\t\t\t\t\t...(slots.tag && { tag: (): VNode[] => slots.tag() }),\n\t\t\t\t\t...(slots.loading && { loading: (): VNode[] => slots.loading() }),\n\t\t\t\t\t...(slots.label && {\n\t\t\t\t\t\tlabel: ({ label, value }: { label: string; value: string | number | boolean | object }): VNode[] =>\n\t\t\t\t\t\t\tslots.label({ label, value }),\n\t\t\t\t\t}),\n\t\t\t\t}}\n\t\t\t</ElTreeSelect>\n\t\t));\n\n\t\treturn useExpose(expose, {\n\t\t\t// TODO:这里 EL 没有返回类型,等待下一个版本修复\n\t\t\t// /** @description 使选择器的输入框获取焦点 */\n\t\t\t// focus: computed(() => treeSelectRef.value?.focus),\n\t\t\t// /** @description 使选择器的输入框失去焦点,并隐藏下拉框 */\n\t\t\t// blur: computed(() => treeSelectRef.value?.blur),\n\t\t\t// /** @description 获取当前选中的标签 */\n\t\t\t// selectedLabel: computed(() => treeSelectRef.value?.selectedLabel),\n\n\t\t\t// /** @description 过滤所有树节点,过滤后的节点将被隐藏 */\n\t\t\t// filter: computed(() => treeSelectRef.value?.filter),\n\t\t\t// /** @description 为节点设置新数据,只有当设置 node-key 属性的时候才可用 */\n\t\t\t// updateKeyChildren: computed(() => treeSelectRef.value?.updateKeyChildren),\n\t\t\t// /** @description 如果节点可以被选中,(show-checkbox 为 true), 本方法将返回当前选中节点的数组 */\n\t\t\t// getCheckedNodes: computed(() => treeSelectRef.value?.getCheckedNodes),\n\t\t\t// /** @description 设置目前勾选的节点,使用此方法必须提前设置 node-key 属性 */\n\t\t\t// setCheckedNodes: computed(() => treeSelectRef.value?.setCheckedNodes),\n\t\t\t// /** @description 若节点可用被选中 (show-checkbox 为 true), 它将返回当前选中节点 key 的数组 */\n\t\t\t// getCheckedKeys: computed(() => treeSelectRef.value?.getCheckedKeys),\n\t\t\t// /** @description 设置目前选中的节点,使用此方法必须设置 node-key 属性 */\n\t\t\t// setCheckedKeys: computed(() => treeSelectRef.value?.setCheckedKeys),\n\t\t\t// /** @description 设置节点是否被选中, 使用此方法必须设置 node-key 属性 */\n\t\t\t// setChecked: computed(() => treeSelectRef.value?.setChecked),\n\t\t\t// /** @description 如果节点可用被选中 (show-checkbox 为 true), 它将返回当前半选中的节点组成的数组 */\n\t\t\t// getHalfCheckedNodes: computed(() => treeSelectRef.value?.getHalfCheckedNodes),\n\t\t\t// /** @description 若节点可被选中(show-checkbox 为 true),则返回目前半选中的节点的 key 所组成的数组 */\n\t\t\t// getHalfCheckedKeys: computed(() => treeSelectRef.value?.getHalfCheckedKeys),\n\t\t\t// /** @description 返回当前被选中节点的数据 (如果没有则返回 null) */\n\t\t\t// getCurrentKey: computed(() => treeSelectRef.value?.getCurrentKey),\n\t\t\t// /** @description 返回当前被选中节点的数据 (如果没有则返回 null) */\n\t\t\t// getCurrentNode: computed(() => treeSelectRef.value?.getCurrentNode),\n\t\t\t// /** @description 通过 key 设置某个节点的当前选中状态,使用此方法必须设置 node-key 属性 */\n\t\t\t// setCurrentKey: computed(() => treeSelectRef.value?.setCurrentKey),\n\t\t\t// /** @description 设置节点为选中状态,使用此方法必须设置 node-key 属性 */\n\t\t\t// setCurrentNode: computed(() => treeSelectRef.value?.setCurrentNode),\n\t\t\t// /** @description 根据 data 或者 key 拿到 Tree 组件中的 node */\n\t\t\t// getNode: computed(() => treeSelectRef.value?.getNode),\n\t\t\t// /** @description 删除 Tree 中的一个节点,使用此方法必须设置 node-key 属性 */\n\t\t\t// remove: computed(() => treeSelectRef.value?.remove),\n\t\t\t// /** @description 为 Tree 中的一个节点追加一个子节点 */\n\t\t\t// append: computed(() => treeSelectRef.value?.append),\n\t\t\t// /** @description 在 Tree 中给定节点前插入一个节点 */\n\t\t\t// insertBefore: computed(() => treeSelectRef.value?.insertBefore),\n\t\t\t// /** @description 在 Tree 中给定节点后插入一个节点 */\n\t\t\t// insertAfter: computed(() => treeSelectRef.value?.insertAfter),\n\t\t\t/** @description 加载状态 */\n\t\t\tloading: computed(() => state.loading),\n\t\t\t/** @description 刷新 */\n\t\t\trefresh: loadData,\n\t\t\t/** @description 设置选择 */\n\t\t\tsetSelection: (value: string | number | boolean | object | (string | number | boolean | object)[]) => handleChange(value),\n\t\t\t/** @description 清除选择 */\n\t\t\tclearSelection: () => handleChange(null),\n\t\t});\n\t},\n});\n"],"names":["faTreeSelectProps","SelectProps","treeProps","disabled","type","Boolean","default","undefined","loadingText","String","noMatchText","noDataText","collapseTags","collapseTagsTooltip","nodeKey","defaultExpandAll","checkOnClickNode","highlightCurrent","expandOnClickNode","collapseOnClickNode","cacheData","definePropType","Array","modelValue","Number","Object","label","width","moreDetail","lazy","defaultSelected","props","hide","children","data","requestApi","Function","initParam","faTreeSelectEmits","selectEmits","treeEmits","value","isString","isNumber","isBoolean","isObject","isArray","isNull","dataChangeCallBack","change","TreeSelect","name","emits","slots","makeSlots","setup","attrs","emit","expose","selectedLabel","useVModel","state","reactive","withDefineType","loading","selectorData","debut","echo","length","nextRefresh","treeSelectRef","ref","handleData","map","m","isFunction","filter","f","loadData","async","params","resData","error","consoleError","handleFilterNode","child","parentNode","parent","labels","level","result","some","indexOf","filterNodeMethod","handleChange","multiple","valueArr","dataList","includes","isNil","find","handleClear","handleNodeClick","node","instance","event","expanded","collapse","expand","checkStrictly","isLeaf","handleVisibleChange","visible","watch","newValue","hasLabel","slice","multipleLimit","item","index","immediate","onMounted","oldValue","isEqual","deep","elTreeSelectProps","useProps","elTreeSelectEmits","useEmits","useRender","_createVNode","ElTreeSelect","_mergeProps","class","popperClass","style","addUnit","$event","onNodeClick","onClear","onVisibleChange","header","footer","prefix","empty","tag","useExpose","computed","refresh","setSelection","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F,aAC/CxF,EAAMyF,QAAU,CAAEA,OAAQA,IAAezF,EAAMyF,aAC/CzF,EAAM0F,QAAU,CAAEA,OAAQA,IAAe1F,EAAM0F,aAC/C1F,EAAM2F,OAAS,CAAEA,MAAOA,IAAe3F,EAAM2F,YAC7C3F,EAAM4F,KAAO,CAAEA,IAAKA,IAAe5F,EAAM4F,UACzC5F,EAAMW,SAAW,CAAEA,QAASA,IAAeX,EAAMW,cACjDX,EAAM3B,OAAS,CAClBA,MAAOA,EAAGA,QAAOe,WAChBY,EAAM3B,MAAM,CAAEA,QAAOe,cAMnByG,EAAUxF,EAAQ,CA8CxBM,QAASmF,EAAS,IAAMtF,EAAMG,SAE9BoF,QAAStE,EAETuE,aAAe5G,GAAuFqD,EAAarD,GAEnH6G,eAAgBA,IAAMxD,EAAa,OAErC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","sources":["../../../../packages/directives/click-copy/index.ts"],"sourcesContent":["/**\n * v-copy\n * 复制某个值至剪贴板\n * 接收参数:string类型/Ref<string>类型/Reactive<string>类型\n */\nimport { ElMessage } from \"element-plus\";\nimport { stringUtil, withInstallDirective } from \"@fast-china/utils\";\nimport type { Directive, DirectiveBinding } from \"vue\";\n\ninterface
|
|
1
|
+
{"version":3,"file":"index.mjs","sources":["../../../../packages/directives/click-copy/index.ts"],"sourcesContent":["/**\n * v-copy\n * 复制某个值至剪贴板\n * 接收参数:string类型/Ref<string>类型/Reactive<string>类型\n */\nimport { ElMessage } from \"element-plus\";\nimport { stringUtil, withInstallDirective } from \"@fast-china/utils\";\nimport type { Directive, DirectiveBinding } from \"vue\";\n\ninterface CopyElement extends HTMLElement {\n\tcopyData: string | number;\n\t__handleClick__: () => void;\n}\n\nconst CopyDirective: Directive = {\n\tmounted(el: CopyElement, binding: DirectiveBinding<string | number>) {\n\t\tel.copyData = binding.value;\n\n\t\tel.__handleClick__ = async (): Promise<void> => {\n\t\t\tif (!el.copyData) return;\n\t\t\ttry {\n\t\t\t\tawait stringUtil.copy(String(el.copyData));\n\t\t\t\tElMessage({\n\t\t\t\t\ttype: \"success\",\n\t\t\t\t\tmessage: \"复制成功\",\n\t\t\t\t});\n\t\t\t} catch (error) {\n\t\t\t\tElMessage({\n\t\t\t\t\ttype: \"error\",\n\t\t\t\t\tmessage: \"复制失败\",\n\t\t\t\t});\n\t\t\t\tthrow error;\n\t\t\t}\n\t\t};\n\t\tel.addEventListener(\"click\", el.__handleClick__);\n\t},\n\tupdated(el: CopyElement, binding: DirectiveBinding) {\n\t\tel.copyData = binding.value;\n\t},\n\tbeforeUnmount(el: CopyElement) {\n\t\tel.removeEventListener(\"click\", el.__handleClick__);\n\t},\n};\n\nexport const vCopy = withInstallDirective(CopyDirective, \"copy\");\nexport default vCopy;\n"],"names":["vCopy","withInstallDirective","mounted","el","binding","copyData","value","__handleClick__","async","stringUtil","copy","String","ElMessage","type","message","error","addEventListener","updated","beforeUnmount","removeEventListener"],"mappings":"kHAcA,MA8BaA,EAAQC,EA9BY,CAChC,OAAAC,CAAQC,EAAiBC,GACxBD,EAAGE,SAAWD,EAAQE,MAEtBH,EAAGI,gBAAkBC,UACpB,GAAKL,EAAGE,SACR,UACOI,EAAWC,KAAKC,OAAOR,EAAGE,WAChCO,EAAU,CACTC,KAAM,UACNC,QAAS,QAEX,OAASC,GAKR,MAJAH,EAAU,CACTC,KAAM,QACNC,QAAS,SAEJC,CACP,GAEDZ,EAAGa,iBAAiB,QAASb,EAAGI,gBACjC,EACA,OAAAU,CAAQd,EAAiBC,GACxBD,EAAGE,SAAWD,EAAQE,KACvB,EACA,aAAAY,CAAcf,GACbA,EAAGgB,oBAAoB,QAAShB,EAAGI,gBACpC,GAGwD"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","sources":["../../../../packages/directives/click-debounce/index.ts"],"sourcesContent":["/**\n * v-debounce\n * 按钮防抖指令\n */\nimport { withInstallDirective } from \"@fast-china/utils\";\nimport type { Directive, DirectiveBinding, VNode } from \"vue\";\n\ninterface
|
|
1
|
+
{"version":3,"file":"index.mjs","sources":["../../../../packages/directives/click-debounce/index.ts"],"sourcesContent":["/**\n * v-debounce\n * 按钮防抖指令\n */\nimport { withInstallDirective } from \"@fast-china/utils\";\nimport type { Directive, DirectiveBinding, VNode } from \"vue\";\n\ninterface DebounceElement extends HTMLElement {\n\t__debounce_timer__: NodeJS.Timeout;\n\t__debounce_originClick__: () => any;\n}\n\ninterface DebounceVNode extends VNode {\n\tprops: {\n\t\t/** @description 点击事件 */\n\t\tonClick?: (...args) => any;\n\t\t[key: string]: any;\n\t};\n}\n\nconst DebounceDirective: Directive = {\n\tcreated(el: DebounceElement, binding: DirectiveBinding, vNode: DebounceVNode) {\n\t\t// 记录原来的点击事件方法\n\t\tel.__debounce_originClick__ = vNode.props.onClick;\n\n\t\t// 替换原来的点击事件\n\t\tvNode.props.onClick = (): void => {\n\t\t\tif (el.__debounce_timer__) {\n\t\t\t\tclearInterval(el.__debounce_timer__);\n\t\t\t}\n\t\t\t// 防抖处理\n\t\t\tel.__debounce_timer__ = setTimeout(() => {\n\t\t\t\tel.__debounce_originClick__();\n\t\t\t}, 500);\n\t\t};\n\t},\n};\n\nexport const vDebounce = withInstallDirective(DebounceDirective, \"debounce\");\nexport default vDebounce;\n"],"names":["vDebounce","withInstallDirective","created","el","binding","vNode","__debounce_originClick__","props","onClick","__debounce_timer__","clearInterval","setTimeout"],"mappings":"yDAoBA,MAkBaA,EAAYC,EAlBY,CACpC,OAAAC,CAAQC,EAAqBC,EAA2BC,GAEvDF,EAAGG,yBAA2BD,EAAME,MAAMC,QAG1CH,EAAME,MAAMC,QAAU,KACjBL,EAAGM,oBACNC,cAAcP,EAAGM,oBAGlBN,EAAGM,mBAAqBE,WAAW,KAClCR,EAAGG,4BACD,KAEL,GAGgE"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","sources":["../../../../packages/directives/click-draggable/index.ts"],"sourcesContent":["/*\n\t需求:实现一个拖拽指令,可在父元素区域任意拖拽元素。\n\n\t思路:\n\t\t1、设置需要拖拽的元素为absolute,其父元素为relative。\n\t\t2、鼠标按下(onmousedown)时记录目标元素当前的 left 和 top 值。\n\t\t3、鼠标移动(onmousemove)时计算每次移动的横向距离和纵向距离的变化值,并改变元素的 left 和 top 值\n\t\t4、鼠标松开(onmouseup)时完成一次拖拽\n\n\t使用:在 Dom 上加上 v-draggable 即可\n\t<div class=\"dialog-model\" v-draggable></div>\n*/\nimport { withInstallDirective } from \"@fast-china/utils\";\nimport type { Directive } from \"vue\";\n\ninterface
|
|
1
|
+
{"version":3,"file":"index.mjs","sources":["../../../../packages/directives/click-draggable/index.ts"],"sourcesContent":["/*\n\t需求:实现一个拖拽指令,可在父元素区域任意拖拽元素。\n\n\t思路:\n\t\t1、设置需要拖拽的元素为absolute,其父元素为relative。\n\t\t2、鼠标按下(onmousedown)时记录目标元素当前的 left 和 top 值。\n\t\t3、鼠标移动(onmousemove)时计算每次移动的横向距离和纵向距离的变化值,并改变元素的 left 和 top 值\n\t\t4、鼠标松开(onmouseup)时完成一次拖拽\n\n\t使用:在 Dom 上加上 v-draggable 即可\n\t<div class=\"dialog-model\" v-draggable></div>\n*/\nimport { withInstallDirective } from \"@fast-china/utils\";\nimport type { Directive } from \"vue\";\n\ninterface DraggableElement extends HTMLElement {\n\tparentNode: any;\n}\n\nconst DraggableDirective: Directive = {\n\tmounted(el: DraggableElement) {\n\t\tel.style.cursor = \"move\";\n\t\tel.style.position = \"absolute\";\n\t\tel.onmousedown = (e): void => {\n\t\t\tconst disX = e.pageX - el.offsetLeft;\n\t\t\tconst disY = e.pageY - el.offsetTop;\n\t\t\tdocument.onmousemove = (e): void => {\n\t\t\t\tlet x = e.pageX - disX;\n\t\t\t\tlet y = e.pageY - disY;\n\t\t\t\tconst maxX = el.parentNode.offsetWidth - el.offsetWidth;\n\t\t\t\tconst maxY = el.parentNode.offsetHeight - el.offsetHeight;\n\t\t\t\tif (x < 0) {\n\t\t\t\t\tx = 0;\n\t\t\t\t} else if (x > maxX) {\n\t\t\t\t\tx = maxX;\n\t\t\t\t}\n\n\t\t\t\tif (y < 0) {\n\t\t\t\t\ty = 0;\n\t\t\t\t} else if (y > maxY) {\n\t\t\t\t\ty = maxY;\n\t\t\t\t}\n\t\t\t\tel.style.left = `${x}px`;\n\t\t\t\tel.style.top = `${y}px`;\n\t\t\t};\n\t\t\tdocument.onmouseup = (): void => {\n\t\t\t\tdocument.onmousemove = document.onmouseup = null;\n\t\t\t};\n\t\t};\n\t},\n};\n\nexport const vDraggable = withInstallDirective(DraggableDirective, \"draggable\");\nexport default vDraggable;\n"],"names":["vDraggable","withInstallDirective","mounted","el","style","cursor","position","onmousedown","e","disX","pageX","offsetLeft","disY","pageY","offsetTop","document","onmousemove","x","y","maxX","parentNode","offsetWidth","maxY","offsetHeight","left","top","onmouseup"],"mappings":"yDAmBA,MAiCaA,EAAaC,EAjCY,CACrC,OAAAC,CAAQC,GACPA,EAAGC,MAAMC,OAAS,OAClBF,EAAGC,MAAME,SAAW,WACpBH,EAAGI,YAAeC,IACjB,MAAMC,EAAOD,EAAEE,MAAQP,EAAGQ,WACpBC,EAAOJ,EAAEK,MAAQV,EAAGW,UAC1BC,SAASC,YAAeR,IACvB,IAAIS,EAAIT,EAAEE,MAAQD,EACdS,EAAIV,EAAEK,MAAQD,EAClB,MAAMO,EAAOhB,EAAGiB,WAAWC,YAAclB,EAAGkB,YACtCC,EAAOnB,EAAGiB,WAAWG,aAAepB,EAAGoB,aACzCN,EAAI,EACPA,EAAI,EACMA,EAAIE,IACdF,EAAIE,GAGDD,EAAI,EACPA,EAAI,EACMA,EAAII,IACdJ,EAAII,GAELnB,EAAGC,MAAMoB,KAAO,GAAGP,MACnBd,EAAGC,MAAMqB,IAAM,GAAGP,OAEnBH,SAASW,UAAY,KACpBX,SAASC,YAAcD,SAASW,UAAY,MAG/C,GAGkE"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","sources":["../../../../packages/directives/click-icon-copy/index.ts"],"sourcesContent":["/**\n * v-iconCopy\n * 左侧插入复制图标,复制某个值至剪贴板\n * 接收参数:string类型/Ref<string>类型/Reactive<string>类型\n */\nimport { type Directive, type DirectiveBinding, h, render } from \"vue\";\nimport { ElIcon, ElMessage } from \"element-plus\";\nimport { CopyDocument } from \"@element-plus/icons-vue\";\nimport { stringUtil, withInstallDirective } from \"@fast-china/utils\";\n\ninterface
|
|
1
|
+
{"version":3,"file":"index.mjs","sources":["../../../../packages/directives/click-icon-copy/index.ts"],"sourcesContent":["/**\n * v-iconCopy\n * 左侧插入复制图标,复制某个值至剪贴板\n * 接收参数:string类型/Ref<string>类型/Reactive<string>类型\n */\nimport { type Directive, type DirectiveBinding, h, render } from \"vue\";\nimport { ElIcon, ElMessage } from \"element-plus\";\nimport { CopyDocument } from \"@element-plus/icons-vue\";\nimport { stringUtil, withInstallDirective } from \"@fast-china/utils\";\n\ninterface IconCopyElement extends HTMLElement {\n\tcopyData: string | number;\n\t__iconElement__: Node;\n}\n\nconst IconCopyDirective: Directive = {\n\tmounted(el: IconCopyElement, binding: DirectiveBinding<string | number>) {\n\t\tel.copyData = binding.value;\n\n\t\tif (!el.copyData) return;\n\n\t\tconst handleCopyClick = async (): Promise<void> => {\n\t\t\ttry {\n\t\t\t\tawait stringUtil.copy(String(el.copyData));\n\t\t\t\tElMessage({\n\t\t\t\t\ttype: \"success\",\n\t\t\t\t\tmessage: \"复制成功\",\n\t\t\t\t});\n\t\t\t} catch (error) {\n\t\t\t\tElMessage({\n\t\t\t\t\ttype: \"error\",\n\t\t\t\t\tmessage: \"复制失败\",\n\t\t\t\t});\n\t\t\t\tthrow error;\n\t\t\t}\n\t\t};\n\n\t\t// 创建 ELIcon 组件\n\t\tconst iconEl = h(\n\t\t\tElIcon,\n\t\t\t{\n\t\t\t\tclass: \"fa__copy-icon\",\n\t\t\t\ttitle: \"复制\",\n\t\t\t\tonClick: handleCopyClick,\n\t\t\t},\n\t\t\t{\n\t\t\t\tdefault: () => h(CopyDocument),\n\t\t\t}\n\t\t);\n\n\t\tconst tempDiv = document.createElement(\"div\");\n\t\trender(iconEl, tempDiv);\n\n\t\tel.__iconElement__ = tempDiv.firstChild;\n\t\tel.parentElement.insertBefore(tempDiv.firstChild, el);\n\t},\n\tupdated(el: IconCopyElement, binding: DirectiveBinding) {\n\t\tel.copyData = binding.value;\n\t},\n\tbeforeUnmount(el: IconCopyElement) {\n\t\tif (el.__iconElement__) {\n\t\t\tel.parentElement.removeChild(el.__iconElement__);\n\t\t}\n\t},\n};\n\nexport const vIconCopy = withInstallDirective(IconCopyDirective, \"iconCopy\");\nexport default vIconCopy;\n"],"names":["vIconCopy","withInstallDirective","mounted","el","binding","copyData","value","iconEl","h","ElIcon","class","title","onClick","async","stringUtil","copy","String","ElMessage","type","message","error","default","CopyDocument","tempDiv","document","createElement","render","__iconElement__","firstChild","parentElement","insertBefore","updated","beforeUnmount","removeChild"],"mappings":"yNAeA,MAmDaA,EAAYC,EAnDY,CACpC,OAAAC,CAAQC,EAAqBC,GAG5B,GAFAD,EAAGE,SAAWD,EAAQE,OAEjBH,EAAGE,SAAU,OAElB,MAiBME,EAASC,EACdC,EACA,CACCC,MAAO,gBACPC,MAAO,KACPC,QAtBsBC,UACvB,UACOC,EAAWC,KAAKC,OAAOb,EAAGE,WAChCY,EAAU,CACTC,KAAM,UACNC,QAAS,QAEX,OAASC,GAKR,MAJAH,EAAU,CACTC,KAAM,QACNC,QAAS,SAEJC,CACP,IAWA,CACCC,QAAS,IAAMb,EAAEc,KAIbC,EAAUC,SAASC,cAAc,OACvCC,EAAOnB,EAAQgB,GAEfpB,EAAGwB,gBAAkBJ,EAAQK,WAC7BzB,EAAG0B,cAAcC,aAAaP,EAAQK,WAAYzB,EACnD,EACA,OAAA4B,CAAQ5B,EAAqBC,GAC5BD,EAAGE,SAAWD,EAAQE,KACvB,EACA,aAAA0B,CAAc7B,GACTA,EAAGwB,iBACNxB,EAAG0B,cAAcI,YAAY9B,EAAGwB,gBAElC,GAGgE"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","sources":["../../../../packages/directives/click-longpress/index.ts"],"sourcesContent":["/**\n * v-longpress\n * 长按指令,长按时触发事件\n */\nimport { withInstallDirective } from \"@fast-china/utils\";\nimport type { Directive, DirectiveBinding } from \"vue\";\n\nconst LongpressDirective: Directive = {\n\tmounted(el: HTMLElement, binding: DirectiveBinding) {\n\t\tif (typeof binding.value !== \"function\") {\n\t\t\tthrow \"callback must be a function\";\n\t\t}\n\n\t\t// 运行函数\n\t\tconst handler = (e: MouseEvent | TouchEvent): void => {\n\t\t\tbinding.value(e);\n\t\t};\n\n\t\t// 定义变量\n\t\tlet pressTimer: any = null;\n\t\t// 创建计时器( 2秒后执行函数 )\n\t\tconst start = (e: any): void => {\n\t\t\tif (e.button) {\n\t\t\t\tif (e.type === \"click\" && e.button !== 0) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (pressTimer === null) {\n\t\t\t\tpressTimer = setTimeout(() => {\n\t\t\t\t\thandler(e);\n\t\t\t\t}, 1000);\n\t\t\t}\n\t\t};\n\t\t// 取消计时器\n\t\tconst cancel = (): void => {\n\t\t\tif (pressTimer !== null) {\n\t\t\t\tclearTimeout(pressTimer);\n\t\t\t\tpressTimer = null;\n\t\t\t}\n\t\t};\n\t\t// 添加事件监听器\n\t\tel.addEventListener(\"mousedown\", start);\n\t\tel.addEventListener(\"touchstart\", start);\n\t\t// 取消计时器\n\t\tel.addEventListener(\"click\", cancel);\n\t\tel.addEventListener(\"mouseout\", cancel);\n\t\tel.addEventListener(\"touchend\", cancel);\n\t\tel.addEventListener(\"touchcancel\", cancel);\n\t},\n};\n\nexport const vLongpress = withInstallDirective(LongpressDirective, \"longpress\");\nexport default vLongpress;\n"],"names":["vLongpress","withInstallDirective","mounted","el","binding","value","pressTimer","start","e","button","type","setTimeout","handler","cancel","clearTimeout","addEventListener"],"mappings":"yDAOA,MA4CaA,EAAaC,EA5CY,CACrC,OAAAC,CAAQC,EAAiBC,GACxB,GAA6B,mBAAlBA,EAAQC,MAClB,KAAM,8BASP,IAAIC,EAAkB,KAEtB,MAAMC,EAASC,IACVA,EAAEC,QACU,UAAXD,EAAEE,MAAiC,IAAbF,EAAEC,QAIV,OAAfH,IACHA,EAAaK,WAAW,KAdV,CAACH,IAChBJ,EAAQC,MAAMG,IAcZI,CAAQJ,IACN,OAICK,EAAS,KACK,OAAfP,IACHQ,aAAaR,GACbA,EAAa,OAIfH,EAAGY,iBAAiB,YAAaR,GACjCJ,EAAGY,iBAAiB,aAAcR,GAElCJ,EAAGY,iBAAiB,QAASF,GAC7BV,EAAGY,iBAAiB,WAAYF,GAChCV,EAAGY,iBAAiB,WAAYF,GAChCV,EAAGY,iBAAiB,cAAeF,EACpC,GAGkE"}
|
|
1
|
+
{"version":3,"file":"index.mjs","sources":["../../../../packages/directives/click-longpress/index.ts"],"sourcesContent":["/**\n * v-longpress\n * 长按指令,长按时触发事件\n */\nimport { withInstallDirective } from \"@fast-china/utils\";\nimport type { Directive, DirectiveBinding } from \"vue\";\n\nconst LongpressDirective: Directive = {\n\tmounted(el: HTMLElement, binding: DirectiveBinding<(event: MouseEvent | TouchEvent) => void>) {\n\t\tif (typeof binding.value !== \"function\") {\n\t\t\tthrow \"callback must be a function\";\n\t\t}\n\n\t\t// 运行函数\n\t\tconst handler = (e: MouseEvent | TouchEvent): void => {\n\t\t\tbinding.value(e);\n\t\t};\n\n\t\t// 定义变量\n\t\tlet pressTimer: any = null;\n\t\t// 创建计时器( 2秒后执行函数 )\n\t\tconst start = (e: any): void => {\n\t\t\tif (e.button) {\n\t\t\t\tif (e.type === \"click\" && e.button !== 0) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (pressTimer === null) {\n\t\t\t\tpressTimer = setTimeout(() => {\n\t\t\t\t\thandler(e);\n\t\t\t\t}, 1000);\n\t\t\t}\n\t\t};\n\t\t// 取消计时器\n\t\tconst cancel = (): void => {\n\t\t\tif (pressTimer !== null) {\n\t\t\t\tclearTimeout(pressTimer);\n\t\t\t\tpressTimer = null;\n\t\t\t}\n\t\t};\n\t\t// 添加事件监听器\n\t\tel.addEventListener(\"mousedown\", start);\n\t\tel.addEventListener(\"touchstart\", start);\n\t\t// 取消计时器\n\t\tel.addEventListener(\"click\", cancel);\n\t\tel.addEventListener(\"mouseout\", cancel);\n\t\tel.addEventListener(\"touchend\", cancel);\n\t\tel.addEventListener(\"touchcancel\", cancel);\n\t},\n};\n\nexport const vLongpress = withInstallDirective(LongpressDirective, \"longpress\");\nexport default vLongpress;\n"],"names":["vLongpress","withInstallDirective","mounted","el","binding","value","pressTimer","start","e","button","type","setTimeout","handler","cancel","clearTimeout","addEventListener"],"mappings":"yDAOA,MA4CaA,EAAaC,EA5CY,CACrC,OAAAC,CAAQC,EAAiBC,GACxB,GAA6B,mBAAlBA,EAAQC,MAClB,KAAM,8BASP,IAAIC,EAAkB,KAEtB,MAAMC,EAASC,IACVA,EAAEC,QACU,UAAXD,EAAEE,MAAiC,IAAbF,EAAEC,QAIV,OAAfH,IACHA,EAAaK,WAAW,KAdV,CAACH,IAChBJ,EAAQC,MAAMG,IAcZI,CAAQJ,IACN,OAICK,EAAS,KACK,OAAfP,IACHQ,aAAaR,GACbA,EAAa,OAIfH,EAAGY,iBAAiB,YAAaR,GACjCJ,EAAGY,iBAAiB,aAAcR,GAElCJ,EAAGY,iBAAiB,QAASF,GAC7BV,EAAGY,iBAAiB,WAAYF,GAChCV,EAAGY,iBAAiB,WAAYF,GAChCV,EAAGY,iBAAiB,cAAeF,EACpC,GAGkE"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","sources":["../../../../packages/directives/click-throttle/index.ts"],"sourcesContent":["/*\n 需求:防止按钮在短时间内被多次点击,使用节流函数限制规定时间内只能点击一次。\n\n 思路:\n 1、第一次点击,立即调用方法并禁用按钮,等延迟结束再次激活按钮\n 2、将需要触发的方法绑定在指令上\n\n 使用:给 Dom 加上 v-throttle 及回调函数即可\n <button v-throttle=\"debounceClick\">节流提交</button>\n*/\nimport { withInstallDirective } from \"@fast-china/utils\";\nimport type { Directive, DirectiveBinding } from \"vue\";\n\ninterface
|
|
1
|
+
{"version":3,"file":"index.mjs","sources":["../../../../packages/directives/click-throttle/index.ts"],"sourcesContent":["/*\n 需求:防止按钮在短时间内被多次点击,使用节流函数限制规定时间内只能点击一次。\n\n 思路:\n 1、第一次点击,立即调用方法并禁用按钮,等延迟结束再次激活按钮\n 2、将需要触发的方法绑定在指令上\n\n 使用:给 Dom 加上 v-throttle 及回调函数即可\n <button v-throttle=\"debounceClick\">节流提交</button>\n*/\nimport { withInstallDirective } from \"@fast-china/utils\";\nimport type { Directive, DirectiveBinding } from \"vue\";\n\ninterface ThrottleElement extends HTMLElement {\n\t__handleClick__: () => any;\n\tdisabled: boolean;\n}\n\nconst ThrottleDirective: Directive = {\n\tmounted(el: ThrottleElement, binding: DirectiveBinding<(...args: any[]) => void>) {\n\t\tif (typeof binding.value !== \"function\") {\n\t\t\tthrow \"callback must be a function\";\n\t\t}\n\t\tlet timer: NodeJS.Timeout | null = null;\n\t\tel.__handleClick__ = (): void => {\n\t\t\tif (timer) {\n\t\t\t\tclearTimeout(timer);\n\t\t\t}\n\t\t\tif (!el.disabled) {\n\t\t\t\tel.disabled = true;\n\t\t\t\tbinding.value();\n\t\t\t\ttimer = setTimeout(() => {\n\t\t\t\t\tel.disabled = false;\n\t\t\t\t}, 1000);\n\t\t\t}\n\t\t};\n\t\tel.addEventListener(\"click\", el.__handleClick__);\n\t},\n\tbeforeUnmount(el: ThrottleElement) {\n\t\tel.removeEventListener(\"click\", el.__handleClick__);\n\t},\n};\n\nexport const vThrottle = withInstallDirective(ThrottleDirective, \"throttle\");\nexport default vThrottle;\n"],"names":["vThrottle","withInstallDirective","mounted","el","binding","value","timer","__handleClick__","clearTimeout","disabled","setTimeout","addEventListener","beforeUnmount","removeEventListener"],"mappings":"yDAkBA,MAyBaA,EAAYC,EAzBY,CACpC,OAAAC,CAAQC,EAAqBC,GAC5B,GAA6B,mBAAlBA,EAAQC,MAClB,KAAM,8BAEP,IAAIC,EAA+B,KACnCH,EAAGI,gBAAkB,KAChBD,GACHE,aAAaF,GAETH,EAAGM,WACPN,EAAGM,UAAW,EACdL,EAAQC,QACRC,EAAQI,WAAW,KAClBP,EAAGM,UAAW,GACZ,OAGLN,EAAGQ,iBAAiB,QAASR,EAAGI,gBACjC,EACA,aAAAK,CAAcT,GACbA,EAAGU,oBAAoB,QAASV,EAAGI,gBACpC,GAGgE"}
|
package/es/index.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{makeInstaller as o}from"./make-installer.mjs";import{INSTALLED_KEY as m}from"./make-installer.mjs";import*as e from"./components/index.mjs";import"./constants/index.mjs";import"./directives/index.mjs";import"./hooks/index.mjs";import{Decimal as r}from"decimal.js";import{FaAvatar as t}from"./components/avatar/index.mjs";import{FaButton as s}from"./components/button/index.mjs";import{faButtonEmits as n,faButtonProps as i}from"./components/button/src/button.mjs";import{CarNumberArea as p,CarNumberDigit as c,CarNumberLetter as f}from"./components/carNumber/src/common.mjs";import{FaCarNumber as l}from"./components/carNumber/index.mjs";import{FaContextMenu as
|
|
1
|
+
import{makeInstaller as o}from"./make-installer.mjs";import{INSTALLED_KEY as m}from"./make-installer.mjs";import*as e from"./components/index.mjs";import"./constants/index.mjs";import"./directives/index.mjs";import"./hooks/index.mjs";import{Decimal as r}from"decimal.js";import{FaAvatar as t}from"./components/avatar/index.mjs";import{FaButton as s}from"./components/button/index.mjs";import{faButtonEmits as n,faButtonProps as i}from"./components/button/src/button.mjs";import{CarNumberArea as p,CarNumberDigit as c,CarNumberLetter as f}from"./components/carNumber/src/common.mjs";import{FaCarNumber as l}from"./components/carNumber/index.mjs";import{FaContextMenu as a}from"./components/contextMenu/index.mjs";import{FaDialog as j}from"./components/dialog/index.mjs";import{faDialogEmits as d,faDialogProps as x}from"./components/dialog/src/dialog.mjs";import{FaDrawer as u}from"./components/drawer/index.mjs";import{formUtil as g}from"./components/form/utils/form.mjs";import{FaForm as b,FaFormItem as k}from"./components/form/index.mjs";import{faFormProps as v}from"./components/form/src/form.mjs";import{faFormItemProps as I}from"./components/form/src/formItem.mjs";import{FaFormItemTip as P}from"./components/formItemTip/index.mjs";import{faFormItemTipProps as y}from"./components/formItemTip/src/formItemTip.mjs";import{FaIcon as h}from"./components/icon/index.mjs";import{FaIconSelector as S}from"./components/iconSelector/index.mjs";import{FaImage as D}from"./components/image/index.mjs";import{faImageProps as T}from"./components/image/src/image.mjs";import{FaInputDialogPage as V}from"./components/inputDialogPage/index.mjs";import{faInputDialogPageEmits as F,faInputDialogPageProps as N}from"./components/inputDialogPage/src/inputDialogPage.mjs";import{FaLayoutGrid as w,FaLayoutGridItem as C}from"./components/layoutGrid/index.mjs";import{FaSelect as E,FaSelectOption as G}from"./components/select/index.mjs";import{SelectProps as M,faSelectProps as q}from"./components/select/src/select.mjs";import{FaSelectPage as z}from"./components/selectPage/index.mjs";import{faSelectPageEmits as A,faSelectPageProps as B}from"./components/selectPage/src/selectPage.mjs";import{FaSelectV2 as H}from"./components/selectV2/index.mjs";import{SelectV2Props as J,faSelectV2Props as K}from"./components/selectV2/src/selectV2.mjs";import{PagedSearchTypeEnum as L}from"./components/table/src/page.type.mjs";import{getTableDefaultSlots as O}from"./components/table/src/table.type.mjs";import{tableUtil as Q}from"./components/table/utils/table.mjs";import{FaTable as R,FaTableColumn as U}from"./components/table/index.mjs";import{faTableEmits as W,faTableProps as X,tableProps as Y}from"./components/table/src/table.mjs";import{tableColumnProps as Z}from"./components/table/src/tableColumn.mjs";import{FaTree as $}from"./components/tree/index.mjs";import{faTreeEmits as _,faTreeProps as oo}from"./components/tree/src/tree.mjs";import{FaTreeSelect as mo}from"./components/treeSelect/index.mjs";import{faTreeSelectEmits as eo,faTreeSelectProps as ro}from"./components/treeSelect/src/treeSelect.mjs";import{FaUpload as to}from"./components/upload/index.mjs";import{faUploadEmits as so,faUploadProps as no}from"./components/upload/src/upload.mjs";import{FaUploadImage as io}from"./components/uploadImage/index.mjs";import{faUploadImageEmits as po,faUploadImageProps as co}from"./components/uploadImage/src/uploadImage.mjs";import{FaUploadImages as fo}from"./components/uploadImages/index.mjs";import{FaMimeType as lo}from"./constants/mime.mjs";import{RegExps as ao}from"./constants/regex.mjs";import{vCopy as jo}from"./directives/click-copy/index.mjs";import{vDebounce as xo}from"./directives/click-debounce/index.mjs";import{vDraggable as uo}from"./directives/click-draggable/index.mjs";import{vIconCopy as go}from"./directives/click-icon-copy/index.mjs";import{vLongpress as bo}from"./directives/click-longpress/index.mjs";import{vThrottle as ko}from"./directives/click-throttle/index.mjs";import{useLoading as vo}from"./hooks/use-loading/index.mjs";import{useOverlay as Io}from"./hooks/use-overlay/index.mjs";import{useScreenFull as Po}from"./hooks/use-screenFull/index.mjs";const yo=o(),ho=yo.install,So=yo.version;export{p as CarNumberArea,c as CarNumberDigit,f as CarNumberLetter,r as Decimal,t as FaAvatar,s as FaButton,l as FaCarNumber,a as FaContextMenu,j as FaDialog,u as FaDrawer,b as FaForm,k as FaFormItem,P as FaFormItemTip,h as FaIcon,S as FaIconSelector,D as FaImage,V as FaInputDialogPage,w as FaLayoutGrid,C as FaLayoutGridItem,lo as FaMimeType,E as FaSelect,G as FaSelectOption,z as FaSelectPage,H as FaSelectV2,R as FaTable,U as FaTableColumn,$ as FaTree,mo as FaTreeSelect,to as FaUpload,io as FaUploadImage,fo as FaUploadImages,e as FastElementPlus,m as INSTALLED_KEY,L as PagedSearchTypeEnum,ao as RegExps,M as SelectProps,J as SelectV2Props,yo as default,n as faButtonEmits,i as faButtonProps,d as faDialogEmits,x as faDialogProps,I as faFormItemProps,y as faFormItemTipProps,v as faFormProps,T as faImageProps,F as faInputDialogPageEmits,N as faInputDialogPageProps,A as faSelectPageEmits,B as faSelectPageProps,q as faSelectProps,K as faSelectV2Props,W as faTableEmits,X as faTableProps,_ as faTreeEmits,oo as faTreeProps,eo as faTreeSelectEmits,ro as faTreeSelectProps,so as faUploadEmits,po as faUploadImageEmits,co as faUploadImageProps,no as faUploadProps,g as formUtil,O as getTableDefaultSlots,ho as install,Z as tableColumnProps,Y as tableProps,Q as tableUtil,vo as useLoading,Io as useOverlay,Po as useScreenFull,jo as vCopy,xo as vDebounce,uo as vDraggable,go as vIconCopy,bo as vLongpress,ko as vThrottle,So as version};
|
|
2
2
|
//# sourceMappingURL=index.mjs.map
|
package/es/index.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","sources":["../../packages/index.ts"],"sourcesContent":["import { makeInstaller } from \"./make-installer\";\n\nexport { INSTALLED_KEY } from \"./make-installer\";\nexport * as FastElementPlus from \"@fast-element-plus/components\";\n\nexport * from \"@fast-element-plus/components\";\nexport * from \"@fast-element-plus/constants\";\nexport * from \"@fast-element-plus/directives\";\nexport * from \"@fast-element-plus/hooks\";\n\nexport { Decimal } from \"decimal.js\";\n\nconst installer = makeInstaller();\n\nexport const install = installer.install;\nexport const version = installer.version;\nexport default installer;\n"],"names":["installer","makeInstaller","install","version"],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.mjs","sources":["../../packages/index.ts"],"sourcesContent":["import { makeInstaller } from \"./make-installer\";\n\nexport { INSTALLED_KEY } from \"./make-installer\";\nexport * as FastElementPlus from \"@fast-element-plus/components\";\n\nexport * from \"@fast-element-plus/components\";\nexport * from \"@fast-element-plus/constants\";\nexport * from \"@fast-element-plus/directives\";\nexport * from \"@fast-element-plus/hooks\";\n\nexport { Decimal } from \"decimal.js\";\n\nconst installer = makeInstaller();\n\nexport const install = installer.install;\nexport const version = installer.version;\nexport default installer;\n"],"names":["installer","makeInstaller","install","version"],"mappings":"skIAYA,MAAMA,GAAYC,IAELC,GAAUF,GAAUE,QACpBC,GAAUH,GAAUG"}
|
package/es/make-installer.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import*as o from"@fast-element-plus/icons-vue";import e from"./component.mjs";import m from"./directive.mjs";import{installElementPlus as r}from"./element-plus.mjs";import{version as s}from"./version.mjs";const t
|
|
1
|
+
import*as o from"@fast-element-plus/icons-vue";import e from"./component.mjs";import m from"./directive.mjs";import{installElementPlus as r}from"./element-plus.mjs";import{version as s}from"./version.mjs";const t=/* @__PURE__ */Symbol("INSTALLED_KEY"),i=()=>({version:s,install:s=>{if(!s[t]){s[t]=!0,r(s);for(const[e,m]of Object.entries(o))s.component(`fa-icon-${e}`,m);e.forEach(o=>s.use(o)),m.forEach(o=>s.use(o))}}});export{t as INSTALLED_KEY,i as makeInstaller};
|
|
2
2
|
//# sourceMappingURL=make-installer.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"make-installer.mjs","sources":["../../packages/make-installer.ts"],"sourcesContent":["import * as FastElementPlusIconsVue from \"@fast-element-plus/icons-vue\";\nimport FastElementPlusComponents from \"./component\";\nimport FastElementPlusDirectives from \"./directive\";\nimport { installElementPlus } from \"./element-plus\";\nimport { version } from \"./version\";\nimport type { App } from \"vue\";\n\nexport const INSTALLED_KEY = Symbol(\"INSTALLED_KEY\");\n\nexport const makeInstaller = (): {\n\tversion: string;\n\tinstall: (app: App) => void;\n} => {\n\tconst install = (app: App): void => {\n\t\tif (app[INSTALLED_KEY]) return;\n\n\t\tapp[INSTALLED_KEY] = true;\n\n\t\tinstallElementPlus(app);\n\n\t\t/** 注册所有 Fast Element Plus Icon */\n\t\tfor (const [key, component] of Object.entries(FastElementPlusIconsVue)) {\n\t\t\t// 这里是给 FaIcon 使用的\n\t\t\tapp.component(`fa-icon-${key}`, component);\n\t\t}\n\n\t\tFastElementPlusComponents.forEach((c) => app.use(c));\n\n\t\tFastElementPlusDirectives.forEach((d) => app.use(d));\n\t};\n\n\treturn {\n\t\tversion,\n\t\tinstall,\n\t};\n};\n"],"names":["INSTALLED_KEY","
|
|
1
|
+
{"version":3,"file":"make-installer.mjs","sources":["../../packages/make-installer.ts"],"sourcesContent":["import * as FastElementPlusIconsVue from \"@fast-element-plus/icons-vue\";\nimport FastElementPlusComponents from \"./component\";\nimport FastElementPlusDirectives from \"./directive\";\nimport { installElementPlus } from \"./element-plus\";\nimport { version } from \"./version\";\nimport type { App } from \"vue\";\n\nexport const INSTALLED_KEY = Symbol(\"INSTALLED_KEY\");\n\nexport const makeInstaller = (): {\n\tversion: string;\n\tinstall: (app: App) => void;\n} => {\n\tconst install = (app: App): void => {\n\t\tif (app[INSTALLED_KEY]) return;\n\n\t\tapp[INSTALLED_KEY] = true;\n\n\t\tinstallElementPlus(app);\n\n\t\t/** 注册所有 Fast Element Plus Icon */\n\t\tfor (const [key, component] of Object.entries(FastElementPlusIconsVue)) {\n\t\t\t// 这里是给 FaIcon 使用的\n\t\t\tapp.component(`fa-icon-${key}`, component);\n\t\t}\n\n\t\tFastElementPlusComponents.forEach((c) => app.use(c));\n\n\t\tFastElementPlusDirectives.forEach((d) => app.use(d));\n\t};\n\n\treturn {\n\t\tversion,\n\t\tinstall,\n\t};\n};\n"],"names":["INSTALLED_KEY","makeInstaller","version","install","app","installElementPlus","key","component","Object","entries","FastElementPlusIconsVue","FastElementPlusComponents","forEach","c","use","FastElementPlusDirectives","d"],"mappings":"6MAOO,MAAMA,wBAAuB,iBAEvBC,EAAgB,KAsBrB,CACNC,UACAC,QApBgBC,IAChB,IAAIA,EAAIJ,GAAR,CAEAI,EAAIJ,IAAiB,EAErBK,EAAmBD,GAGnB,IAAA,MAAYE,EAAKC,KAAcC,OAAOC,QAAQC,GAE7CN,EAAIG,UAAU,WAAWD,IAAOC,GAGjCI,EAA0BC,QAASC,GAAMT,EAAIU,IAAID,IAEjDE,EAA0BH,QAASI,GAAMZ,EAAIU,IAAIE,GAdzB"}
|
package/es/version.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const version = "1.0.
|
|
1
|
+
export declare const version = "1.0.10";
|
package/es/version.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
const o="1.0.
|
|
1
|
+
const o="1.0.10";export{o as version};
|
|
2
2
|
//# sourceMappingURL=version.mjs.map
|
package/es/version.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"version.mjs","sources":["../../packages/version.ts"],"sourcesContent":["export const version = \"1.0.
|
|
1
|
+
{"version":3,"file":"version.mjs","sources":["../../packages/version.ts"],"sourcesContent":["export const version = \"1.0.10\";\n"],"names":["version"],"mappings":"AAAO,MAAMA,EAAU"}
|
|
@@ -20,7 +20,7 @@ export declare const faAvatarProps: {
|
|
|
20
20
|
src: import('element-plus/es/utils/index.mjs').EpPropFinalized<StringConstructor, unknown, unknown, "", boolean>;
|
|
21
21
|
alt: StringConstructor;
|
|
22
22
|
srcSet: StringConstructor;
|
|
23
|
-
fit: import('element-plus/es/utils/index.mjs').EpPropFinalized<(new (...args: any[]) => "fill" | "contain" | "-moz-initial" | "inherit" | "initial" | "revert" | "unset" | "none" | "cover" | "scale-down") | (() =>
|
|
23
|
+
fit: import('element-plus/es/utils/index.mjs').EpPropFinalized<(new (...args: any[]) => "fill" | "contain" | "-moz-initial" | "inherit" | "initial" | "revert" | "revert-layer" | "unset" | "none" | "cover" | "scale-down") | (() => import("csstype").Property.ObjectFit | undefined) | ((new (...args: any[]) => "fill" | "contain" | "-moz-initial" | "inherit" | "initial" | "revert" | "revert-layer" | "unset" | "none" | "cover" | "scale-down") | (() => import("csstype").Property.ObjectFit | undefined))[], unknown, unknown, "cover", boolean>;
|
|
24
24
|
};
|
|
25
25
|
export declare const faAvatarEmits: {
|
|
26
26
|
error: (evt: Event) => boolean;
|
|
@@ -52,7 +52,7 @@ declare const _default: import('vue').DefineComponent<import('vue').ExtractPropT
|
|
|
52
52
|
src: import('element-plus/es/utils/index.mjs').EpPropFinalized<StringConstructor, unknown, unknown, "", boolean>;
|
|
53
53
|
alt: StringConstructor;
|
|
54
54
|
srcSet: StringConstructor;
|
|
55
|
-
fit: import('element-plus/es/utils/index.mjs').EpPropFinalized<(new (...args: any[]) => "fill" | "contain" | "-moz-initial" | "inherit" | "initial" | "revert" | "unset" | "none" | "cover" | "scale-down") | (() =>
|
|
55
|
+
fit: import('element-plus/es/utils/index.mjs').EpPropFinalized<(new (...args: any[]) => "fill" | "contain" | "-moz-initial" | "inherit" | "initial" | "revert" | "revert-layer" | "unset" | "none" | "cover" | "scale-down") | (() => import("csstype").Property.ObjectFit | undefined) | ((new (...args: any[]) => "fill" | "contain" | "-moz-initial" | "inherit" | "initial" | "revert" | "revert-layer" | "unset" | "none" | "cover" | "scale-down") | (() => import("csstype").Property.ObjectFit | undefined))[], unknown, unknown, "cover", boolean>;
|
|
56
56
|
}>, {
|
|
57
57
|
/** @description 图片路径 */
|
|
58
58
|
src: string;
|
|
@@ -79,7 +79,7 @@ declare const _default: import('vue').DefineComponent<import('vue').ExtractPropT
|
|
|
79
79
|
src: import('element-plus/es/utils/index.mjs').EpPropFinalized<StringConstructor, unknown, unknown, "", boolean>;
|
|
80
80
|
alt: StringConstructor;
|
|
81
81
|
srcSet: StringConstructor;
|
|
82
|
-
fit: import('element-plus/es/utils/index.mjs').EpPropFinalized<(new (...args: any[]) => "fill" | "contain" | "-moz-initial" | "inherit" | "initial" | "revert" | "unset" | "none" | "cover" | "scale-down") | (() =>
|
|
82
|
+
fit: import('element-plus/es/utils/index.mjs').EpPropFinalized<(new (...args: any[]) => "fill" | "contain" | "-moz-initial" | "inherit" | "initial" | "revert" | "revert-layer" | "unset" | "none" | "cover" | "scale-down") | (() => import("csstype").Property.ObjectFit | undefined) | ((new (...args: any[]) => "fill" | "contain" | "-moz-initial" | "inherit" | "initial" | "revert" | "revert-layer" | "unset" | "none" | "cover" | "scale-down") | (() => import("csstype").Property.ObjectFit | undefined))[], unknown, unknown, "cover", boolean>;
|
|
83
83
|
}>> & Readonly<{
|
|
84
84
|
onError?: (evt: Event) => any;
|
|
85
85
|
}>, {
|
|
@@ -92,6 +92,6 @@ declare const _default: import('vue').DefineComponent<import('vue').ExtractPropT
|
|
|
92
92
|
thumb: boolean;
|
|
93
93
|
shape: import('element-plus/es/utils/index.mjs').EpPropMergeType<StringConstructor, "circle" | "square", unknown>;
|
|
94
94
|
src: string;
|
|
95
|
-
fit: any
|
|
95
|
+
fit: import('element-plus/es/utils/index.mjs').EpPropMergeType<(new (...args: any[]) => "fill" | "contain" | "-moz-initial" | "inherit" | "initial" | "revert" | "revert-layer" | "unset" | "none" | "cover" | "scale-down") | (() => import("csstype").Property.ObjectFit | undefined) | ((new (...args: any[]) => "fill" | "contain" | "-moz-initial" | "inherit" | "initial" | "revert" | "revert-layer" | "unset" | "none" | "cover" | "scale-down") | (() => import("csstype").Property.ObjectFit | undefined))[], unknown, unknown>;
|
|
96
96
|
}, import('vue').SlotsType<Partial<import('@fast-china/utils').MakeSlots<FaAvatarSlots>>>, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
|
|
97
97
|
export default _default;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),a=require("element-plus"),r=require("@element-plus/icons-vue"),s=require("@fast-china/utils"),t={...a.avatarProps,icon:{type:s.definePropType([String,Object,Function]),default:()=>r.Picture},base64:Boolean,original:Boolean,normal:Boolean,small:Boolean,thumb:Boolean},o={...a.avatarEmits},l=e.defineComponent({name:"FaAvatar",props:t,emits:o,slots:s.makeSlots(),setup(r,{attrs:t,slots:o,emit:l,expose:u}){const n=e.reactive({src:e.computed(()=>{if(r.src)return r.base64?`data:image/png;base64,${r.src}`:r.original?r.src:r.normal?`${r.src}@!normal`:r.small?`${r.src}@!small`:(r.thumb,`${r.src}@!thumb`)})}),i=s.useProps(r,a.avatarProps,["src"]),c=s.useEmits(a.avatarEmits,l);return s.useRender(()=>e.createVNode(a.ElAvatar,e.mergeProps(i.value,c.value,{class:"fa-avatar",src:n.src}),{default:()=>[o.default&&o.default({src:n.src})]})),s.useExpose(u,{src:n.src})}});exports.default=l,exports.faAvatarEmits=o,exports.faAvatarProps=t;
|
|
2
2
|
//# sourceMappingURL=avatar.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"avatar.js","sources":["../../../../../packages/components/avatar/src/avatar.tsx"],"sourcesContent":["import { computed, defineComponent, reactive } from \"vue\";\nimport { ElAvatar, avatarEmits, avatarProps } from \"element-plus\";\nimport { Picture } from \"@element-plus/icons-vue\";\nimport { definePropType, makeSlots, useExpose, useProps, useRender } from \"@fast-china/utils\";\nimport type { Component } from \"vue\";\n\nexport const faAvatarProps = {\n\t...avatarProps,\n\t/** @description representation type to icon, more info on icon component. */\n\ticon: {\n\t\ttype: definePropType<string | Component>([String, Object, Function]),\n\t\tdefault: (): string | Component => Picture,\n\t},\n\t/** @description Base64图片 */\n\tbase64: Boolean,\n\t/** @description 原图 */\n\toriginal: Boolean,\n\t/** @description 标准 */\n\tnormal: Boolean,\n\t/** @description 小图 */\n\tsmall: Boolean,\n\t/** @description 缩略图 */\n\tthumb: Boolean,\n};\n\nexport const faAvatarEmits = {\n\t...avatarEmits,\n};\n\ntype FaAvatarSlots = {\n\t/** @description 默认内容插槽 */\n\tdefault: { src: string };\n};\n\nexport default defineComponent({\n\tname: \"FaAvatar\",\n\tprops: faAvatarProps,\n\temits: faAvatarEmits,\n\tslots: makeSlots<FaAvatarSlots>(),\n\tsetup(props, { attrs, slots, emit, expose }) {\n\t\tconst state = reactive({\n\t\t\tsrc: computed(() => {\n\t\t\t\tif (!props.src) return undefined;\n\t\t\t\tif (props.base64) {\n\t\t\t\t\treturn `data:image/png;base64,${props.src}`;\n\t\t\t\t} else if (props.original) {\n\t\t\t\t\treturn props.src;\n\t\t\t\t} else if (props.normal) {\n\t\t\t\t\treturn `${props.src}@!normal`;\n\t\t\t\t} else if (props.small) {\n\t\t\t\t\treturn `${props.src}@!small`;\n\t\t\t\t} else if (props.thumb) {\n\t\t\t\t\treturn `${props.src}@!thumb`;\n\t\t\t\t} else {\n\t\t\t\t\t// 默认使用缩略图\n\t\t\t\t\treturn `${props.src}@!thumb`;\n\t\t\t\t}\n\t\t\t}),\n\t\t});\n\n\t\tconst elAvatarProps = useProps(props, avatarProps, [\"src\"]);\n\n\t\tuseRender(() => (\n\t\t\t<ElAvatar {...elAvatarProps.value} class=\"fa-avatar\" src={state.src}
|
|
1
|
+
{"version":3,"file":"avatar.js","sources":["../../../../../packages/components/avatar/src/avatar.tsx"],"sourcesContent":["import { computed, defineComponent, reactive } from \"vue\";\nimport { ElAvatar, avatarEmits, avatarProps } from \"element-plus\";\nimport { Picture } from \"@element-plus/icons-vue\";\nimport { definePropType, makeSlots, useEmits, useExpose, useProps, useRender } from \"@fast-china/utils\";\nimport type { Component } from \"vue\";\n\nexport const faAvatarProps = {\n\t...avatarProps,\n\t/** @description representation type to icon, more info on icon component. */\n\ticon: {\n\t\ttype: definePropType<string | Component>([String, Object, Function]),\n\t\tdefault: (): string | Component => Picture,\n\t},\n\t/** @description Base64图片 */\n\tbase64: Boolean,\n\t/** @description 原图 */\n\toriginal: Boolean,\n\t/** @description 标准 */\n\tnormal: Boolean,\n\t/** @description 小图 */\n\tsmall: Boolean,\n\t/** @description 缩略图 */\n\tthumb: Boolean,\n};\n\nexport const faAvatarEmits = {\n\t...avatarEmits,\n};\n\ntype FaAvatarSlots = {\n\t/** @description 默认内容插槽 */\n\tdefault: { src: string };\n};\n\nexport default defineComponent({\n\tname: \"FaAvatar\",\n\tprops: faAvatarProps,\n\temits: faAvatarEmits,\n\tslots: makeSlots<FaAvatarSlots>(),\n\tsetup(props, { attrs, slots, emit, expose }) {\n\t\tconst state = reactive({\n\t\t\tsrc: computed(() => {\n\t\t\t\tif (!props.src) return undefined;\n\t\t\t\tif (props.base64) {\n\t\t\t\t\treturn `data:image/png;base64,${props.src}`;\n\t\t\t\t} else if (props.original) {\n\t\t\t\t\treturn props.src;\n\t\t\t\t} else if (props.normal) {\n\t\t\t\t\treturn `${props.src}@!normal`;\n\t\t\t\t} else if (props.small) {\n\t\t\t\t\treturn `${props.src}@!small`;\n\t\t\t\t} else if (props.thumb) {\n\t\t\t\t\treturn `${props.src}@!thumb`;\n\t\t\t\t} else {\n\t\t\t\t\t// 默认使用缩略图\n\t\t\t\t\treturn `${props.src}@!thumb`;\n\t\t\t\t}\n\t\t\t}),\n\t\t});\n\n\t\tconst elAvatarProps = useProps(props, avatarProps, [\"src\"]);\n\t\tconst elAvatarEmits = useEmits(avatarEmits, emit);\n\n\t\tuseRender(() => (\n\t\t\t<ElAvatar {...elAvatarProps.value} {...elAvatarEmits.value} class=\"fa-avatar\" src={state.src}>\n\t\t\t\t{slots.default && slots.default({ src: state.src })}\n\t\t\t</ElAvatar>\n\t\t));\n\n\t\treturn useExpose(expose, {\n\t\t\t/** @description 图片路径 */\n\t\t\tsrc: state.src,\n\t\t});\n\t},\n});\n"],"names":["faAvatarProps","avatarProps","icon","type","definePropType","String","Object","Function","default","Picture","base64","Boolean","original","normal","small","thumb","faAvatarEmits","avatarEmits","Avatar","name","props","emits","slots","makeSlots","setup","attrs","emit","expose","state","reactive","src","computed","elAvatarProps","useProps","elAvatarEmits","useEmits","useRender","_createVNode","ElAvatar","_mergeProps","value","class","useExpose"],"mappings":"iOAMaA,EAAgB,IACzBC,EAAAA,YAEHC,KAAM,CACLC,KAAMC,EAAAA,eAAmC,CAACC,OAAQC,OAAQC,WAC1DC,QAASA,IAA0BC,EAAAA,SAGpCC,OAAQC,QAERC,SAAUD,QAEVE,OAAQF,QAERG,MAAOH,QAEPI,MAAOJ,SAGKK,EAAgB,IACzBC,EAAAA,aAQJC,oBAA+B,CAC9BC,KAAM,WACNC,MAAOpB,EACPqB,MAAOL,EACPM,MAAOC,EAAAA,YACPC,KAAAA,CAAMJ,GAAOK,MAAEA,EAAAA,MAAOH,EAAAA,KAAOI,EAAAA,OAAMC,IAClC,MAAMC,EAAQC,EAAAA,SAAS,CACtBC,IAAKC,EAAAA,SAAS,KACb,GAAKX,EAAMU,IACX,OAAIV,EAAMV,OACF,yBAAyBU,EAAMU,MAC5BV,EAAMR,SACTQ,EAAMU,IACHV,EAAMP,OACT,GAAGO,EAAMU,cACNV,EAAMN,MACT,GAAGM,EAAMU,cACNV,EAAML,MACT,GAAGK,EAAMU,kBAQbE,EAAgBC,EAAAA,SAASb,EAAOnB,EAAAA,YAAa,CAAC,QAC9CiC,EAAgBC,EAAAA,SAASlB,EAAAA,YAAaS,GAQ5C,OANAU,YAAU,IAAAC,EAAAA,YAAAC,WAAAC,EAAAA,WACKP,EAAcQ,MAAWN,EAAcM,MAAK,CAAAC,MAAA,YAAAX,IAAyBF,EAAME,MAAG,CAAAtB,QAAAA,IAAA,CAC1Fc,EAAMd,SAAWc,EAAMd,QAAQ,CAAEsB,IAAKF,EAAME,UAIxCY,EAAAA,UAAUf,EAAQ,CAExBG,IAAKF,EAAME,KAEb"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"button.js","sources":["../../../../../packages/components/button/src/button.tsx"],"sourcesContent":["import { computed, defineComponent, reactive, ref, watch, withModifiers } from \"vue\";\nimport { ElButton, buttonEmits, buttonProps } from \"element-plus\";\nimport { Eleme } from \"@element-plus/icons-vue\";\nimport { useOverlay } from \"@fast-element-plus/hooks\";\nimport { consoleError, definePropType, execFunction, makeSlots, useExpose, useProps, useRender } from \"@fast-china/utils\";\nimport { isFunction } from \"lodash-unified\";\nimport type { ButtonInstance } from \"element-plus\";\nimport type { Component, VNode } from \"vue\";\n\nexport const faButtonProps = {\n\t...buttonProps,\n\t/**\n\t * @description customize loading icon component\n\t * @default Eleme\n\t */\n\tloadingIcon: {\n\t\ttype: definePropType<string | Component>([String, Object, Function]),\n\t\tdefault: (): string | Component => Eleme,\n\t},\n\t/** @description 禁用加载 */\n\tdisabledLoading: Boolean,\n};\n\nexport const faButtonEmits = {\n\t...buttonEmits,\n\t/**\n\t * @description 点击事件\n\t * @param done 需要手动隐藏Loading\n\t */\n\
|
|
1
|
+
{"version":3,"file":"button.js","sources":["../../../../../packages/components/button/src/button.tsx"],"sourcesContent":["import { computed, defineComponent, reactive, ref, watch, withModifiers } from \"vue\";\nimport { ElButton, buttonEmits, buttonProps } from \"element-plus\";\nimport { Eleme } from \"@element-plus/icons-vue\";\nimport { useOverlay } from \"@fast-element-plus/hooks\";\nimport { consoleError, definePropType, execFunction, makeSlots, useExpose, useProps, useRender } from \"@fast-china/utils\";\nimport { isFunction } from \"lodash-unified\";\nimport type { ButtonInstance } from \"element-plus\";\nimport type { Component, VNode } from \"vue\";\n\nexport const faButtonProps = {\n\t...buttonProps,\n\t/**\n\t * @description customize loading icon component\n\t * @default Eleme\n\t */\n\tloadingIcon: {\n\t\ttype: definePropType<string | Component>([String, Object, Function]),\n\t\tdefault: (): string | Component => Eleme,\n\t},\n\t/** @description 禁用加载 */\n\tdisabledLoading: Boolean,\n};\n\nexport const faButtonEmits = {\n\t...buttonEmits,\n\t/**\n\t * @description 点击事件\n\t * @param done 需要手动隐藏Loading\n\t */\n\tclick: (event: MouseEvent, done: () => void = () => {}): boolean => event instanceof MouseEvent && isFunction(done),\n};\n\ntype FaButtonSlots = {\n\t/** @description 默认内容插槽 */\n\tdefault: never;\n\t/** @description 自定义加载中组件 */\n\tloading: never;\n\t/** @description 自定义图标组件 */\n\ticon: never;\n};\n\nexport default defineComponent({\n\tname: \"FaButton\",\n\tprops: faButtonProps,\n\temits: faButtonEmits,\n\tslots: makeSlots<FaButtonSlots>(),\n\tsetup(props, { attrs, slots, emit, expose }) {\n\t\tconst state = reactive({\n\t\t\tloading: false,\n\t\t});\n\n\t\tconst buttonRef = ref<ButtonInstance>();\n\n\t\tconst showLoading = (): void => {\n\t\t\tstate.loading = true;\n\t\t\t// 这里默认透明\n\t\t\tuseOverlay.show(0);\n\t\t};\n\n\t\tconst hideLoading = (): void => {\n\t\t\tstate.loading = false;\n\t\t\tuseOverlay.hide();\n\t\t};\n\n\t\tconst handleLoading = (loadingFunction: () => void | Promise<void>): void => {\n\t\t\tstate.loading = true;\n\t\t\texecFunction(loadingFunction)\n\t\t\t\t.then()\n\t\t\t\t.catch((error) => {\n\t\t\t\t\tconsoleError(\"FaButton\", error);\n\t\t\t\t})\n\t\t\t\t.finally(() => {\n\t\t\t\t\tstate.loading = false;\n\t\t\t\t});\n\t\t};\n\n\t\tconst handleClick = (event: MouseEvent): void => {\n\t\t\tif (props.disabledLoading) {\n\t\t\t\t// 回调点击事件\n\t\t\t\temit(\"click\", event);\n\t\t\t} else {\n\t\t\t\tshowLoading();\n\t\t\t\t// 回调点击事件\n\t\t\t\temit(\"click\", event, hideLoading);\n\t\t\t}\n\t\t};\n\n\t\t/**\n\t\t * 监听外部 loading 的值\n\t\t */\n\t\twatch(\n\t\t\t() => props.loading,\n\t\t\t(newValue) => {\n\t\t\t\tif (props.disabledLoading) return;\n\t\t\t\tif (newValue) {\n\t\t\t\t\tshowLoading();\n\t\t\t\t} else {\n\t\t\t\t\thideLoading();\n\t\t\t\t}\n\t\t\t},\n\t\t\t{\n\t\t\t\timmediate: true,\n\t\t\t}\n\t\t);\n\n\t\tconst elButtonProps = useProps(props, buttonProps, [\"loading\"]);\n\n\t\tuseRender(() => (\n\t\t\t<ElButton\n\t\t\t\t{...elButtonProps.value}\n\t\t\t\tref={buttonRef}\n\t\t\t\tclass=\"fa-button\"\n\t\t\t\tloading={state.loading}\n\t\t\t\tonClick={withModifiers((event: Event) => handleClick(event as MouseEvent), [\"prevent\"])}\n\t\t\t>\n\t\t\t\t{{\n\t\t\t\t\tdefault: () => slots.default && slots.default(),\n\t\t\t\t\t...(slots.loading && { loading: (): VNode[] => slots.loading() }),\n\t\t\t\t\t...(slots.icon && { icon: (): VNode[] => slots.icon() }),\n\t\t\t\t}}\n\t\t\t</ElButton>\n\t\t));\n\n\t\treturn useExpose(expose, {\n\t\t\t/** @description 按钮 html 元素 */\n\t\t\tref: computed(() => buttonRef.value?.ref),\n\t\t\t/** @description 按钮尺寸 */\n\t\t\tsize: computed(() => buttonRef.value?.size),\n\t\t\t/** @description 按钮类型 */\n\t\t\ttype: computed(() => buttonRef.value?.type),\n\t\t\t/** @description 按钮已禁用 */\n\t\t\tdisabled: computed(() => buttonRef.value?.disabled),\n\t\t\t/** @description 是否在两个字符之间插入空格 */\n\t\t\tshouldAddSpace: computed(() => buttonRef.value?.shouldAddSpace),\n\t\t\t/** @description 加载状态 */\n\t\t\tloading: computed(() => state.loading),\n\t\t\t/** @description 按钮加载 */\n\t\t\tdoLoading: handleLoading,\n\t\t});\n\t},\n});\n"],"names":["faButtonProps","buttonProps","loadingIcon","type","definePropType","String","Object","Function","default","Eleme","disabledLoading","Boolean","faButtonEmits","buttonEmits","click","event","done","MouseEvent","isFunction","Button","name","props","emits","slots","makeSlots","setup","attrs","emit","expose","state","reactive","loading","buttonRef","ref","showLoading","useOverlay","show","hideLoading","hide","watch","newValue","immediate","elButtonProps","useProps","useRender","_createVNode","ElButton","_mergeProps","value","class","onClick","withModifiers","handleClick","icon","useExpose","computed","size","disabled","shouldAddSpace","doLoading","loadingFunction","execFunction","then","catch","error","consoleError","finally"],"mappings":"uVASaA,EAAgB,IACzBC,EAAAA,YAKHC,YAAa,CACZC,KAAMC,EAAAA,eAAmC,CAACC,OAAQC,OAAQC,WAC1DC,QAASA,IAA0BC,EAAAA,OAGpCC,gBAAiBC,SAGLC,EAAgB,IACzBC,EAAAA,YAKHC,MAAOA,CAACC,EAAmBC,EAAmBA,SAAsBD,aAAiBE,YAAcC,EAAAA,WAAWF,IAY/GG,oBAA+B,CAC9BC,KAAM,WACNC,MAAOrB,EACPsB,MAAOV,EACPW,MAAOC,EAAAA,YACPC,KAAAA,CAAMJ,GAAOK,MAAEA,EAAAA,MAAOH,EAAAA,KAAOI,EAAAA,OAAMC,IAClC,MAAMC,EAAQC,EAAAA,SA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,KACRrC,EAAME,SAAU,MAmEpB"}
|
|
@@ -1,4 +1,9 @@
|
|
|
1
1
|
declare const _default: import('vue').DefineComponent<import('vue').ExtractPropTypes<{
|
|
2
|
+
/** @description v-model绑定值 */
|
|
3
|
+
modelValue: {
|
|
4
|
+
type: StringConstructor;
|
|
5
|
+
default: any;
|
|
6
|
+
};
|
|
2
7
|
/** @description placeholder */
|
|
3
8
|
placeholder: {
|
|
4
9
|
type: StringConstructor;
|
|
@@ -15,7 +20,6 @@ declare const _default: import('vue').DefineComponent<import('vue').ExtractPropT
|
|
|
15
20
|
__epPropKey: true;
|
|
16
21
|
};
|
|
17
22
|
disabled: import('element-plus/es/utils/index.mjs').EpPropFinalized<BooleanConstructor, unknown, unknown, undefined, boolean>;
|
|
18
|
-
modelValue: import('element-plus/es/utils/index.mjs').EpPropFinalized<(new (...args: any[]) => string | number) | (() => string | number | null | undefined) | ((new (...args: any[]) => string | number) | (() => string | number | null | undefined))[], unknown, unknown, "", boolean>;
|
|
19
23
|
modelModifiers: import('element-plus/es/utils/index.mjs').EpPropFinalized<(new (...args: any[]) => import('element-plus').InputModelModifiers) | (() => import('element-plus').InputModelModifiers) | ((new (...args: any[]) => import('element-plus').InputModelModifiers) | (() => import('element-plus').InputModelModifiers))[], unknown, unknown, () => {}, boolean>;
|
|
20
24
|
maxlength: {
|
|
21
25
|
readonly type: import('vue').PropType<import('element-plus/es/utils/index.mjs').EpPropMergeType<readonly [StringConstructor, NumberConstructor], unknown, unknown>>;
|
|
@@ -88,7 +92,7 @@ declare const _default: import('vue').DefineComponent<import('vue').ExtractPropT
|
|
|
88
92
|
containerRole: import('element-plus/es/utils/index.mjs').EpPropFinalized<StringConstructor, unknown, unknown, undefined, boolean>;
|
|
89
93
|
tabindex: import('element-plus/es/utils/index.mjs').EpPropFinalized<readonly [StringConstructor, NumberConstructor], unknown, unknown, 0, boolean>;
|
|
90
94
|
validateEvent: import('element-plus/es/utils/index.mjs').EpPropFinalized<BooleanConstructor, unknown, unknown, true, boolean>;
|
|
91
|
-
inputStyle: import('element-plus/es/utils/index.mjs').EpPropFinalized<(new (...args: any[]) => string | import('vue').CSSProperties | import('vue').StyleValue[]) | (() => import('vue').StyleValue) | ((new (...args: any[]) => string | import('vue').CSSProperties | import('vue').StyleValue[]) | (() => import('vue').StyleValue))[], unknown, unknown, () => import('element-plus/es/utils/typescript.mjs').Mutable<{}>, boolean>;
|
|
95
|
+
inputStyle: import('element-plus/es/utils/index.mjs').EpPropFinalized<(new (...args: any[]) => string | false | import('vue').CSSProperties | import('vue').StyleValue[]) | (() => import('vue').StyleValue) | ((new (...args: any[]) => string | false | import('vue').CSSProperties | import('vue').StyleValue[]) | (() => import('vue').StyleValue))[], unknown, unknown, () => import('element-plus/es/utils/typescript.mjs').Mutable<{}>, boolean>;
|
|
92
96
|
autofocus: BooleanConstructor;
|
|
93
97
|
rows: import('element-plus/es/utils/index.mjs').EpPropFinalized<NumberConstructor, unknown, unknown, 2, boolean>;
|
|
94
98
|
}>, void, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
@@ -97,6 +101,11 @@ declare const _default: import('vue').DefineComponent<import('vue').ExtractPropT
|
|
|
97
101
|
/** @description 改变 */
|
|
98
102
|
change: (value: string) => boolean;
|
|
99
103
|
}, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<{
|
|
104
|
+
/** @description v-model绑定值 */
|
|
105
|
+
modelValue: {
|
|
106
|
+
type: StringConstructor;
|
|
107
|
+
default: any;
|
|
108
|
+
};
|
|
100
109
|
/** @description placeholder */
|
|
101
110
|
placeholder: {
|
|
102
111
|
type: StringConstructor;
|
|
@@ -113,7 +122,6 @@ declare const _default: import('vue').DefineComponent<import('vue').ExtractPropT
|
|
|
113
122
|
__epPropKey: true;
|
|
114
123
|
};
|
|
115
124
|
disabled: import('element-plus/es/utils/index.mjs').EpPropFinalized<BooleanConstructor, unknown, unknown, undefined, boolean>;
|
|
116
|
-
modelValue: import('element-plus/es/utils/index.mjs').EpPropFinalized<(new (...args: any[]) => string | number) | (() => string | number | null | undefined) | ((new (...args: any[]) => string | number) | (() => string | number | null | undefined))[], unknown, unknown, "", boolean>;
|
|
117
125
|
modelModifiers: import('element-plus/es/utils/index.mjs').EpPropFinalized<(new (...args: any[]) => import('element-plus').InputModelModifiers) | (() => import('element-plus').InputModelModifiers) | ((new (...args: any[]) => import('element-plus').InputModelModifiers) | (() => import('element-plus').InputModelModifiers))[], unknown, unknown, () => {}, boolean>;
|
|
118
126
|
maxlength: {
|
|
119
127
|
readonly type: import('vue').PropType<import('element-plus/es/utils/index.mjs').EpPropMergeType<readonly [StringConstructor, NumberConstructor], unknown, unknown>>;
|
|
@@ -186,7 +194,7 @@ declare const _default: import('vue').DefineComponent<import('vue').ExtractPropT
|
|
|
186
194
|
containerRole: import('element-plus/es/utils/index.mjs').EpPropFinalized<StringConstructor, unknown, unknown, undefined, boolean>;
|
|
187
195
|
tabindex: import('element-plus/es/utils/index.mjs').EpPropFinalized<readonly [StringConstructor, NumberConstructor], unknown, unknown, 0, boolean>;
|
|
188
196
|
validateEvent: import('element-plus/es/utils/index.mjs').EpPropFinalized<BooleanConstructor, unknown, unknown, true, boolean>;
|
|
189
|
-
inputStyle: import('element-plus/es/utils/index.mjs').EpPropFinalized<(new (...args: any[]) => string | import('vue').CSSProperties | import('vue').StyleValue[]) | (() => import('vue').StyleValue) | ((new (...args: any[]) => string | import('vue').CSSProperties | import('vue').StyleValue[]) | (() => import('vue').StyleValue))[], unknown, unknown, () => import('element-plus/es/utils/typescript.mjs').Mutable<{}>, boolean>;
|
|
197
|
+
inputStyle: import('element-plus/es/utils/index.mjs').EpPropFinalized<(new (...args: any[]) => string | false | import('vue').CSSProperties | import('vue').StyleValue[]) | (() => import('vue').StyleValue) | ((new (...args: any[]) => string | false | import('vue').CSSProperties | import('vue').StyleValue[]) | (() => import('vue').StyleValue))[], unknown, unknown, () => import('element-plus/es/utils/typescript.mjs').Mutable<{}>, boolean>;
|
|
190
198
|
autofocus: BooleanConstructor;
|
|
191
199
|
rows: import('element-plus/es/utils/index.mjs').EpPropFinalized<NumberConstructor, unknown, unknown, 2, boolean>;
|
|
192
200
|
}>> & Readonly<{
|
|
@@ -197,9 +205,9 @@ declare const _default: import('vue').DefineComponent<import('vue').ExtractPropT
|
|
|
197
205
|
id: string;
|
|
198
206
|
disabled: import('element-plus/es/utils/index.mjs').EpPropMergeType<BooleanConstructor, unknown, unknown>;
|
|
199
207
|
autofocus: boolean;
|
|
208
|
+
modelValue: string;
|
|
200
209
|
placeholder: string;
|
|
201
210
|
inputmode: import('element-plus/es/utils/index.mjs').EpPropMergeType<(new (...args: any[]) => "search" | "text" | "none" | "url" | "email" | "tel" | "numeric" | "decimal") | (() => "search" | "text" | "none" | "url" | "email" | "tel" | "numeric" | "decimal" | undefined) | ((new (...args: any[]) => "search" | "text" | "none" | "url" | "email" | "tel" | "numeric" | "decimal") | (() => "search" | "text" | "none" | "url" | "email" | "tel" | "numeric" | "decimal" | undefined))[], unknown, unknown>;
|
|
202
|
-
modelValue: import('element-plus/es/utils/index.mjs').EpPropMergeType<(new (...args: any[]) => string | number) | (() => string | number | null | undefined) | ((new (...args: any[]) => string | number) | (() => string | number | null | undefined))[], unknown, unknown>;
|
|
203
211
|
modelModifiers: import('element-plus').InputModelModifiers;
|
|
204
212
|
autosize: false;
|
|
205
213
|
autocomplete: AutoFill;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),t=require("element-plus"),
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),t=require("element-plus"),r=require("@element-plus/icons-vue");require("../../../constants/index.js");const a=require("@fast-china/utils"),l=require("lodash-unified"),o=require("./common.js"),u=require("@vueuse/core"),n=require("../../../constants/regex.js");function i(t){return"function"==typeof t||"[object Object]"===Object.prototype.toString.call(t)&&!e.isVNode(t)}const d=e.defineComponent({name:"FaCarNumber",props:{...t.inputProps,modelValue:{type:String,default:void 0},placeholder:{type:String,default:"请选择"}},emits:{"update:modelValue":e=>l.isString(e)||l.isNull(e),change:e=>l.isString(e)||l.isNull(e)},setup(l,{attrs:d,slots:s,emit:c,expose:p}){const v=u.useVModel(l,"modelValue",c),m=e.reactive({switchLetter:e.computed(()=>v.value?.length>=1),disabledButton:e.computed(()=>v.value?.length>=8)}),_=e.ref(),b=e.inject(t.formContextKey,void 0),f=e.inject(t.formItemContextKey,void 0),g=e=>2===e.length?`${e} ● `:e.length>2?`${e.slice(0,2)} ● ${e.slice(2)}`:e,h=e=>{v.value??="",v.value+=e},N=()=>{0!==v.value?.length&&(v.value=v.value.substring(0,v.value.length-1))},V=()=>{let e=!1;7===v.value.length?e=n.RegExps.CarNumber.test(v.value):8===v.value.length&&(e=n.RegExps.NewEnergyCarNumber.test(v.value)),e?(c("change",v.value),f?.prop&&b?.validateField([f.prop])):f?.prop&&b?(c("change",v.value),b.validateField([f.prop])):t.ElMessage.error("车牌号格式不正确"),_.value?.hide()},C=()=>{v.value=null,c("change",null),f?.prop&&b?.validateField([f.prop])},y=a.useProps(l,t.inputProps,["modelValue","readonly","formatter"]);a.useRender(()=>e.createVNode(t.ElPopover,{ref:_,width:"auto",popperClass:"fa-car-number__popover",trigger:"click",showArrow:!1,showAfter:0,hideAfter:0},{reference:()=>e.createVNode(t.ElInput,e.mergeProps(y.value,{class:"fa-car-number__input",modelValue:v.value,"onUpdate:modelValue":e=>v.value=e,readonly:!0,formatter:g}),null),default:()=>e.createVNode(e.Fragment,null,[e.createVNode("div",{class:["fa-car-number__popover__area",m.switchLetter?"fa-car-number__popover__hide":""]},[o.CarNumberArea.map(r=>e.createVNode(t.ElButton,{disabled:m.disabledButton,onClick:()=>h(r)},i(r)?r:{default:()=>[r]}))]),e.createVNode("div",{class:["fa-car-number__popover__digit-letter",m.switchLetter?"":"fa-car-number__popover__hide"]},[o.CarNumberDigit.map(r=>e.createVNode(t.ElButton,{disabled:m.disabledButton,onClick:()=>h(r)},i(r)?r:{default:()=>[r]})),o.CarNumberLetter.map(r=>e.createVNode(t.ElButton,{disabled:m.disabledButton,onClick:()=>h(r)},i(r)?r:{default:()=>[r]}))]),e.createVNode("div",{class:"fa-car-number__popover__btn"},[e.createVNode(t.ElButton,{class:"fa-car-number__popover__btn__clear",disabled:null===v.value||0===v.value.length,onClick:C},{default:()=>[e.createTextVNode("清除")]}),e.createVNode(t.ElButton,{class:"fa-car-number__popover__btn__back",type:"danger",icon:r.Back,disabled:null===v.value||0===v.value.length,onClick:N},null),e.createVNode(t.ElButton,{class:"fa-car-number__popover__btn__confirm",type:"primary",disabled:null===v.value||v.value.length<7,onClick:V},{default:()=>[e.createTextVNode("确认")]})])])}))}});exports.default=d;
|
|
2
2
|
//# sourceMappingURL=carNumber.js.map
|