orion-design 0.1.20 → 0.1.22
Sign up to get free protection for your applications and to get access to all the features.
- package/README.md +5 -5
- package/dist/components/Form/NumberInput/NumberInput.d.ts +19 -0
- package/dist/components/Form/NumberInput/NumberInput.js +2 -0
- package/dist/components/Form/NumberInput/NumberInput.js.map +1 -0
- package/dist/components/Form/NumberInput/NumberInput.vue.d.ts +3 -0
- package/dist/components/Form/NumberInput/index.d.ts +1 -0
- package/dist/components/Form/NumberInput/index.js +2 -0
- package/dist/components/Form/NumberInput/index.js.map +1 -0
- package/dist/components/Form/index.d.ts +3 -0
- package/dist/components/Form/index.js +318 -247
- package/dist/components/Form/index.js.map +1 -1
- package/dist/components/LovTable/LovPagetable.vue.d.ts +20 -2
- package/dist/components/LovTable/LovQuerytable.vue.d.ts +20 -2
- package/dist/components/LovTable/index.d.ts +20 -2
- package/dist/components/Pagetable/Pagetable.d.ts +4 -1
- package/dist/components/Pagetable/index.d.ts +4 -1
- package/dist/components/Pagetable/index.js +258 -243
- package/dist/components/Pagetable/index.js.map +1 -1
- package/dist/components/Querytable/Querytable.d.ts +4 -1
- package/dist/components/Querytable/index.d.ts +4 -1
- package/dist/components/Querytable/index.js +166 -151
- package/dist/components/Querytable/index.js.map +1 -1
- package/dist/components/_util/arrays.js.map +1 -1
- package/dist/components/_util/browser.js.map +1 -1
- package/dist/components/_util/dom/aria.js.map +1 -1
- package/dist/components/_util/dom/element.js.map +1 -1
- package/dist/components/_util/dom/event.js.map +1 -1
- package/dist/components/_util/dom/position.js.map +1 -1
- package/dist/components/_util/dom/scroll.js.map +1 -1
- package/dist/components/_util/dom/style.js.map +1 -1
- package/dist/components/_util/easings.js.map +1 -1
- package/dist/components/_util/error.js.map +1 -1
- package/dist/components/_util/i18n.js.map +1 -1
- package/dist/components/_util/objects.js.map +1 -1
- package/dist/components/_util/raf.js.map +1 -1
- package/dist/components/_util/rand.js.map +1 -1
- package/dist/components/_util/strings.js.map +1 -1
- package/dist/components/_util/throttleByRaf.js.map +1 -1
- package/dist/components/_util/types.js.map +1 -1
- package/dist/components/_util/typescript.js.map +1 -1
- package/dist/components/_util/vue/global-node.js.map +1 -1
- package/dist/components/_util/vue/icon.js.map +1 -1
- package/dist/components/_util/vue/install.js.map +1 -1
- package/dist/components/_util/vue/props/runtime.js.map +1 -1
- package/dist/components/_util/vue/refs.js.map +1 -1
- package/dist/components/_util/vue/size.js.map +1 -1
- package/dist/components/_util/vue/validator.js.map +1 -1
- package/dist/components/_util/vue/vnode.js.map +1 -1
- package/dist/version/version.d.ts +1 -1
- package/dist/version/version.js +1 -1
- package/dist/version/version.js.map +1 -1
- package/package.json +1 -1
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../../src/components/Form/Form.vue","../../../src/components/Form/StringInput/StringInput.vue","../../../src/components/Form/PasswordInput/PasswordInput.vue","../../../src/components/Form/Textarea/Textarea.vue","../../../src/components/Form/SingleSelect/SingleSelect.vue","../../../src/components/Form/MultiSelect/MultiSelect.vue","../../../src/components/Form/RadioGroup/RadioGroup.vue","../../../src/components/Form/CheckboxGroup/CheckboxGroup.vue","../../../src/components/Form/Checkbox/Checkbox.vue","../../../src/components/Form/Switch/Switch.vue","../../../src/components/Form/DateInput/DateInput.vue","../../../src/components/Form/FileInput/FileInput.vue","../../../src/components/Form/ButtonGroup/ButtonGroup.vue","../../../src/components/Form/DiyItem/DiyItem.vue","../../../src/components/Form/LovInput/LovInput.vue","../../../src/components/Form/index.ts"],"sourcesContent":["<template>\r\n <el-form ref=\"form\" :model=\"modelValue\" :rules=\"rules\" :label-width=\"itemLabelWidth\" :disabled=\"disabled\">\r\n <el-row :gutter=\"16\">\r\n <slot></slot>\r\n </el-row>\r\n </el-form>\r\n</template>\r\n\r\n<script setup lang=\"ts\">\r\nimport { provide, reactive, toRef, useTemplateRef } from 'vue'\r\nimport { ElForm, ElRow } from 'element-plus'\r\nimport { type FormProps, type FormExpose, formContextKey } from './Form'\r\nimport OrionError from '../../error/OrionError'\r\nimport { difference, isEmpty } from 'lodash-es'\r\n\r\ndefineOptions({ name: 'OForm', inheritAttrs: false })\r\n\r\nconst { rules, itemSpan = 6, itemLabelWidth = 'auto', disabled = false, modelValue } = defineProps<FormProps>()\r\n\r\nconst emit = defineEmits(['update:modelValue'])\r\n\r\nconst updateModelValue = (name: string, value: any) => {\r\n if (!Object.keys(modelValue).includes(name)) {\r\n throw new OrionError(`modelValue中不存在[${name}]`)\r\n }\r\n emit('update:modelValue', { ...modelValue, [name]: value })\r\n}\r\n\r\nconst updateModelValueMulti = (data: Record<string, any>) => {\r\n const modelKeys = Object.keys(modelValue)\r\n const dataKeys = Object.keys(data)\r\n const diff = difference(dataKeys, modelKeys)\r\n if (!isEmpty(diff)) {\r\n throw new OrionError(`modelValue中不存在[${diff.join(',')}]`)\r\n }\r\n emit('update:modelValue', { ...modelValue, ...data })\r\n}\r\n\r\nconst formRef = useTemplateRef('form')\r\n\r\nconst validate: FormExpose['validate'] = async () => {\r\n return await formRef.value!.validate()\r\n}\r\n\r\ndefineExpose({\r\n validate,\r\n})\r\n\r\nprovide(\r\n formContextKey,\r\n reactive({\r\n modelValue: toRef(() => modelValue),\r\n updateModelValue,\r\n updateModelValueMulti,\r\n rules: toRef(() => rules),\r\n itemSpan: toRef(() => itemSpan),\r\n disabled: toRef(() => disabled),\r\n })\r\n)\r\n</script>\r\n","<template>\r\n <el-col :span=\"normalizedSpan\">\r\n <el-form-item :prop=\"name\" :label=\"label\" :label-width=\"labelWidth\" :required=\"required\" :rules=\"normalizedRules\">\r\n <el-input v-model=\"elModel\" :maxlength=\"maxlength\" :placeholder=\"placeholder\" :disabled=\"disabled\" :readonly=\"readonly\" />\r\n </el-form-item>\r\n </el-col>\r\n</template>\r\n\r\n<script setup lang=\"ts\">\r\nimport { ElCol, ElFormItem, ElInput } from 'element-plus'\r\nimport type { StringInputProps } from './StringInput'\r\nimport { useFormItemSpan, useFormItemRules, useFormItemStringModel } from '../hooks'\r\n\r\ndefineOptions({ name: 'OFormString', inheritAttrs: false })\r\n\r\nconst { name, label, labelWidth, required, maxlength, placeholder, disabled, readonly } = defineProps<StringInputProps>()\r\nconst normalizedSpan = useFormItemSpan()\r\nconst normalizedRules = useFormItemRules()\r\nconst elModel = useFormItemStringModel()\r\n</script>\r\n","<template>\r\n <el-col :span=\"normalizedSpan\">\r\n <el-form-item :prop=\"name\" :label=\"label\" :label-width=\"labelWidth\" :required=\"required\" :rules=\"normalizedRules\">\r\n <el-input v-model=\"elModel\" :maxlength=\"maxlength\" :placeholder=\"placeholder\" :disabled=\"disabled\" :readonly=\"readonly\" type=\"password\" />\r\n </el-form-item>\r\n </el-col>\r\n</template>\r\n\r\n<script setup lang=\"ts\">\r\nimport { ElCol, ElFormItem, ElInput } from 'element-plus'\r\nimport type { PasswordInputProps } from './PasswordInput'\r\nimport { useFormItemSpan, useFormItemRules, useFormItemStringModel } from '../hooks'\r\n\r\ndefineOptions({ name: 'OFormPassword', inheritAttrs: false })\r\n\r\nconst { name, label, labelWidth, required, maxlength, placeholder, disabled, readonly } = defineProps<PasswordInputProps>()\r\nconst normalizedSpan = useFormItemSpan()\r\nconst normalizedRules = useFormItemRules()\r\nconst elModel = useFormItemStringModel()\r\n</script>\r\n","<template>\r\n <el-col :span=\"normalizedSpan\">\r\n <el-form-item :prop=\"name\" :label=\"label\" :label-width=\"labelWidth\" :required=\"required\" :rules=\"normalizedRules\">\r\n <el-input\r\n v-model=\"elModel\"\r\n :maxlength=\"maxlength\"\r\n :placeholder=\"placeholder\"\r\n :disabled=\"disabled\"\r\n :readonly=\"readonly\"\r\n type=\"textarea\"\r\n :rows=\"rows\"\r\n :resize=\"'none'\"\r\n />\r\n </el-form-item>\r\n </el-col>\r\n</template>\r\n\r\n<script setup lang=\"ts\">\r\nimport { ElCol, ElFormItem, ElInput } from 'element-plus'\r\nimport type { TextareaProps } from './Textarea'\r\nimport { useFormItemSpan, useFormItemRules, useFormItemStringModel } from '../hooks'\r\n\r\ndefineOptions({ name: 'OFormTextarea', inheritAttrs: false })\r\n\r\nconst { name, label, labelWidth, required, maxlength, placeholder, disabled, readonly, rows } = defineProps<TextareaProps>()\r\nconst normalizedSpan = useFormItemSpan()\r\nconst normalizedRules = useFormItemRules()\r\nconst elModel = useFormItemStringModel()\r\n</script>\r\n","<template>\r\n <el-col :span=\"normalizedSpan\">\r\n <el-form-item :prop=\"name\" :label=\"label\" :label-width=\"labelWidth\" :required=\"required\" :rules=\"normalizedRules\">\r\n <el-input v-if=\"normalizedDisabled\" :model-value=\"content\" :placeholder=\"placeholder\" :disabled=\"true\" :readonly=\"true\" />\r\n <el-select v-else v-model=\"elModel\" :placeholder=\"placeholder\" :clearable=\"clearable\" :filterable=\"filterable\">\r\n <el-option v-for=\"codeItem in normalizedCode\" :key=\"codeItem.value\" :label=\"codeItem.content\" :value=\"codeItem.value\" />\r\n </el-select>\r\n </el-form-item>\r\n </el-col>\r\n</template>\r\n\r\n<script setup lang=\"ts\">\r\nimport { computed } from 'vue'\r\nimport { ElCol, ElFormItem, ElInput, ElSelect, ElOption } from 'element-plus'\r\nimport type { SingleSelectProps } from './SingleSelect'\r\nimport { useFormItemSpan, useFormItemRules, useFormItemDisabled, useFormItemCode, useFormItemStringModel } from '../hooks'\r\nimport { getSingleCodeContent } from '../utils'\r\n\r\ndefineOptions({ name: 'OFormSingleselect', inheritAttrs: false })\r\n\r\nconst { name, label, labelWidth, required, placeholder, clearable, filterable } = defineProps<SingleSelectProps>()\r\nconst normalizedSpan = useFormItemSpan()\r\nconst normalizedRules = useFormItemRules()\r\nconst normalizedDisabled = useFormItemDisabled()\r\nconst normalizedCode = useFormItemCode()\r\nconst elModel = useFormItemStringModel()\r\nconst content = computed(() => getSingleCodeContent(normalizedCode.value, elModel.value))\r\n</script>\r\n","<template>\r\n <el-col :span=\"normalizedSpan\">\r\n <el-form-item :prop=\"name\" :label=\"label\" :label-width=\"labelWidth\" :required=\"required\" :rules=\"normalizedRules\">\r\n <el-input v-if=\"normalizedDisabled\" :model-value=\"content\" :placeholder=\"placeholder\" :disabled=\"true\" :readonly=\"true\" />\r\n <el-select v-else v-model=\"elModel\" :placeholder=\"placeholder\" multiple>\r\n <el-option v-for=\"codeItem in normalizedCode\" :key=\"codeItem.value\" :label=\"codeItem.content\" :value=\"codeItem.value\" />\r\n </el-select>\r\n </el-form-item>\r\n </el-col>\r\n</template>\r\n\r\n<script setup lang=\"ts\">\r\nimport { computed } from 'vue'\r\nimport { ElCol, ElFormItem, ElInput, ElSelect, ElOption } from 'element-plus'\r\nimport type { MultiSelectProps } from './MultiSelect'\r\nimport { useFormContext, useFormItemSpan, useFormItemRules, useFormItemDisabled, useFormItemCode, useFormItemMultiModel } from '../hooks'\r\nimport { getMultiCodeContent } from '../utils'\r\n\r\ndefineOptions({ name: 'OFormMultiselect', inheritAttrs: false })\r\n\r\nconst { name, label, labelWidth, required, placeholder } = defineProps<MultiSelectProps>()\r\nconst normalizedSpan = useFormItemSpan()\r\nconst normalizedRules = useFormItemRules()\r\nconst normalizedDisabled = useFormItemDisabled()\r\nconst normalizedCode = useFormItemCode()\r\nconst elModel = useFormItemMultiModel()\r\nconst formContext = useFormContext()!\r\nconst content = computed(() => getMultiCodeContent(normalizedCode.value, formContext.modelValue[name]))\r\n</script>\r\n","<template>\r\n <el-col :span=\"normalizedSpan\">\r\n <el-form-item :prop=\"name\" :label=\"label\" :label-width=\"labelWidth\" :required=\"required\" :rules=\"normalizedRules\">\r\n <el-radio-group v-model=\"elModel\" :disabled=\"disabled\">\r\n <el-radio v-for=\"codeItem in normalizedCode\" :key=\"codeItem.value\" :value=\"codeItem.value\">\r\n {{ codeItem.content }}\r\n </el-radio>\r\n </el-radio-group>\r\n </el-form-item>\r\n </el-col>\r\n</template>\r\n\r\n<script setup lang=\"ts\">\r\nimport { ElCol, ElFormItem, ElRadioGroup, ElRadio } from 'element-plus'\r\nimport type { RadioGroupProps } from './RadioGroup'\r\nimport { useFormItemSpan, useFormItemRules, useFormItemCode, useFormItemStringModel } from '../hooks'\r\n\r\ndefineOptions({ name: 'OFormRadiogroup', inheritAttrs: false })\r\n\r\nconst { name, label, labelWidth, required, disabled } = defineProps<RadioGroupProps>()\r\nconst normalizedSpan = useFormItemSpan()\r\nconst normalizedRules = useFormItemRules()\r\nconst normalizedCode = useFormItemCode()\r\nconst elModel = useFormItemStringModel()\r\n</script>\r\n","<template>\r\n <el-col :span=\"normalizedSpan\">\r\n <el-form-item :prop=\"name\" :label=\"label\" :label-width=\"labelWidth\" :required=\"required\" :rules=\"normalizedRules\">\r\n <el-checkbox-group v-model=\"elModel\" :disabled=\"disabled\">\r\n <el-checkbox v-for=\"codeItem in normalizedCode\" :key=\"codeItem.value\" :label=\"codeItem.content\" :value=\"codeItem.value\" />\r\n </el-checkbox-group>\r\n </el-form-item>\r\n </el-col>\r\n</template>\r\n\r\n<script setup lang=\"ts\">\r\nimport { ElCol, ElFormItem, ElCheckboxGroup, ElCheckbox } from 'element-plus'\r\nimport type { CheckboxGroupProps } from './CheckboxGroup'\r\nimport { useFormItemSpan, useFormItemRules, useFormItemCode, useFormItemMultiModel } from '../hooks'\r\n\r\ndefineOptions({ name: 'OFormCheckboxgroup', inheritAttrs: false })\r\n\r\nconst { name, label, labelWidth, required, disabled } = defineProps<CheckboxGroupProps>()\r\nconst normalizedSpan = useFormItemSpan()\r\nconst normalizedRules = useFormItemRules()\r\nconst normalizedCode = useFormItemCode()\r\nconst elModel = useFormItemMultiModel()\r\n</script>\r\n","<template>\r\n <el-col :span=\"normalizedSpan\">\r\n <el-form-item :prop=\"name\" :label=\"label\" :label-width=\"labelWidth\" :rules=\"rules\">\r\n <el-checkbox v-model=\"elModel\" :disabled=\"disabled\"></el-checkbox>\r\n </el-form-item>\r\n </el-col>\r\n</template>\r\n\r\n<script setup lang=\"ts\">\r\nimport { ElCol, ElFormItem, ElCheckbox } from 'element-plus'\r\nimport type { CheckboxProps } from './Checkbox'\r\nimport { useFormItemBooleanModel, useFormItemSpan } from '../hooks'\r\n\r\ndefineOptions({ name: 'OFormCheckbox', inheritAttrs: false })\r\n\r\nconst { name, label, labelWidth, rules, disabled } = defineProps<CheckboxProps>()\r\nconst normalizedSpan = useFormItemSpan()\r\nconst elModel = useFormItemBooleanModel()\r\n</script>\r\n","<template>\r\n <el-col :span=\"normalizedSpan\">\r\n <el-form-item :prop=\"name\" :label=\"label\" :label-width=\"labelWidth\" :rules=\"rules\">\r\n <el-switch v-model=\"elModel\" :disabled=\"disabled\" />\r\n </el-form-item>\r\n </el-col>\r\n</template>\r\n\r\n<script setup lang=\"ts\">\r\nimport { ElCol, ElFormItem, ElSwitch } from 'element-plus'\r\nimport type { SwitchProps } from './Switch'\r\nimport { useFormItemBooleanModel, useFormItemSpan } from '../hooks'\r\n\r\ndefineOptions({ name: 'OFormSwitch', inheritAttrs: false })\r\n\r\nconst { name, label, labelWidth, rules, disabled } = defineProps<SwitchProps>()\r\nconst normalizedSpan = useFormItemSpan()\r\nconst elModel = useFormItemBooleanModel()\r\n</script>\r\n","<template>\r\n <el-col :span=\"normalizedSpan\">\r\n <el-form-item :prop=\"name\" :label=\"label\" :label-width=\"labelWidth\" :required=\"required\" :rules=\"normalizedRules\">\r\n <el-time-picker\r\n v-if=\"isTimePicker\"\r\n v-model=\"elModel\"\r\n :placeholder=\"placeholder\"\r\n :disabled=\"disabled\"\r\n :readonly=\"readonly\"\r\n :editable=\"editable\"\r\n :clearable=\"clearable\"\r\n :format=\"normalizedSourceFormat\"\r\n arrow-control\r\n style=\"width: 100%\"\r\n />\r\n <el-date-picker\r\n v-else\r\n v-model=\"elModel\"\r\n :placeholder=\"placeholder\"\r\n :disabled=\"disabled\"\r\n :readonly=\"readonly\"\r\n :editable=\"editable\"\r\n :clearable=\"clearable\"\r\n :type=\"dateType\"\r\n :format=\"normalizedSourceFormat\"\r\n style=\"width: 100%\"\r\n />\r\n </el-form-item>\r\n </el-col>\r\n</template>\r\n\r\n<script setup lang=\"ts\">\r\nimport { computed } from 'vue'\r\nimport { ElCol, ElFormItem, ElDatePicker, ElTimePicker, dayjs } from 'element-plus'\r\nimport type { DateInputProps } from './DateInput'\r\nimport { useFormContext, useFormItemSpan, useFormItemRules } from '../hooks'\r\nimport { isDate, isString } from 'lodash-es'\r\nimport OrionError from '../../../error/OrionError'\r\n\r\ndefineOptions({ name: 'OFormDate', inheritAttrs: false })\r\n\r\nconst {\r\n name,\r\n label,\r\n labelWidth,\r\n required,\r\n placeholder,\r\n disabled,\r\n readonly,\r\n editable,\r\n clearable,\r\n format = 'YYYY-MM-DD',\r\n sourceFormat,\r\n} = defineProps<DateInputProps>()\r\nconst normalizedSpan = useFormItemSpan()\r\nconst normalizedRules = useFormItemRules()\r\n\r\nconst isTimePicker = computed(() => format.startsWith('H') || format.startsWith('h') || format.startsWith('m') || format.startsWith('s'))\r\n\r\nconst normalizedSourceFormat = computed(() => {\r\n if (sourceFormat) {\r\n return sourceFormat\r\n }\r\n if (isTimePicker.value) {\r\n return 'HH:mm:ss'\r\n } else {\r\n return 'YYYY-MM-DD'\r\n }\r\n})\r\n\r\nconst dateType = computed(() => {\r\n let picker: 'date' | 'year' | 'month' | 'datetime' = 'date'\r\n\r\n // 配置年 yyyy指年 YYYY指周年,年末年初的值可能有所变化\r\n if (format.indexOf('y') > -1 || format.indexOf('Y') > -1) {\r\n picker = 'year'\r\n }\r\n\r\n // 配置月,M指月份,m指分钟\r\n if (format.indexOf('M') > -1) {\r\n picker = 'month'\r\n }\r\n\r\n // 配置日,d指星期,D指月的天,DDD指年的天\r\n if (format.indexOf('d') > -1 || format.indexOf('D') > -1) {\r\n picker = 'date'\r\n }\r\n\r\n // 配置小时,H指24小时制(0~23),k指24小时制(1~24),h指12小时制,m指分钟,s指秒,S指小数秒\r\n if (\r\n format.indexOf('H') > -1 ||\r\n format.indexOf('h') > -1 ||\r\n format.indexOf('k') > -1 ||\r\n format.indexOf('m') > -1 ||\r\n format.indexOf('s') > -1 ||\r\n format.indexOf('S') > -1\r\n ) {\r\n picker = 'datetime'\r\n }\r\n\r\n return picker\r\n})\r\n\r\nconst formContext = useFormContext()!\r\nconst elModel = computed<Date | undefined>({\r\n get: () => {\r\n const value = formContext.modelValue[name]\r\n if (!value) {\r\n return undefined\r\n }\r\n if (isDate(value)) {\r\n return value as Date\r\n } else if (isString(value)) {\r\n const dayjsObj = dayjs(value, normalizedSourceFormat.value, true)\r\n if (!dayjsObj.isValid()) {\r\n throw new OrionError(`日期输入框的值无效,不符合${normalizedSourceFormat.value}格式`)\r\n }\r\n return dayjsObj.toDate()\r\n } else {\r\n throw new OrionError('日期输入框的值只能为字符串或日期类型')\r\n }\r\n },\r\n set: (newValue) => {\r\n if (sourceFormat) {\r\n if (!newValue) {\r\n formContext.updateModelValue(name, '')\r\n } else {\r\n formContext.updateModelValue(name, dayjs(newValue).format(normalizedSourceFormat.value))\r\n }\r\n } else {\r\n if (!newValue) {\r\n formContext.updateModelValue(name, undefined)\r\n } else {\r\n formContext.updateModelValue(name, newValue)\r\n }\r\n }\r\n },\r\n})\r\n</script>\r\n","<template>\r\n <el-col :span=\"normalizedSpan\">\r\n <el-form-item :prop=\"name\" :label=\"label\" :label-width=\"labelWidth\" :required=\"required\" :rules=\"normalizedRules\">\r\n <el-input ref=\"inputRef\" v-model=\"file\" :disabled=\"disabled\" type=\"file\" :validate-event=\"false\" />\r\n </el-form-item>\r\n </el-col>\r\n</template>\r\n\r\n<script setup lang=\"ts\">\r\nimport { onMounted, ref, useTemplateRef, watch } from 'vue'\r\nimport { ElCol, ElFormItem, ElInput } from 'element-plus'\r\nimport type { FileInputProps } from './FileInput'\r\nimport { useFormItemSpan, useFormItemRules, useFormItemStringModel } from '../hooks'\r\n\r\ndefineOptions({ name: 'OFormFile', inheritAttrs: false })\r\n\r\nconst { name, label, labelWidth, required, disabled } = defineProps<FileInputProps>()\r\nconst normalizedSpan = useFormItemSpan()\r\nconst normalizedRules = useFormItemRules()\r\nconst elModel = useFormItemStringModel()\r\nwatch(elModel, () => {\r\n if (!elModel.value) {\r\n file.value = ''\r\n }\r\n})\r\n\r\nconst file = ref('')\r\nconst fileRef = useTemplateRef('inputRef')\r\nonMounted(() => {\r\n fileRef.value!.input!.onchange = (event) => {\r\n //@ts-ignore\r\n elModel.value = event?.target?.files[0]\r\n }\r\n file.value = ''\r\n})\r\n</script>\r\n","<template>\r\n <el-col :span=\"normalizedSpan\" :style=\"style\">\r\n <space :gutter=\"gutter\" style=\"margin-bottom: 18px\"> <slot></slot> </space>\r\n </el-col>\r\n</template>\r\n\r\n<script setup lang=\"ts\">\r\nimport { ElCol } from 'element-plus'\r\nimport type { ButtonGroupProps } from './ButtonGroup'\r\nimport Space from '../../Space'\r\nimport { useFormItemSpan } from '../hooks'\r\nimport { computed, CSSProperties } from 'vue'\r\n\r\ndefineOptions({ name: 'OFormButtongroup', inheritAttrs: false })\r\n\r\nconst { gutter, align = 'right' } = defineProps<ButtonGroupProps>()\r\nconst style = computed<CSSProperties>(() => {\r\n return {\r\n textAlign: align,\r\n }\r\n})\r\n\r\nconst normalizedSpan = useFormItemSpan()\r\n</script>\r\n","<template>\r\n <el-col :span=\"normalizedSpan\">\r\n <el-form-item :prop=\"name\" :label=\"label\" :label-width=\"labelWidth\" :required=\"required\" :rules=\"normalizedRules\">\r\n <slot></slot>\r\n </el-form-item>\r\n </el-col>\r\n</template>\r\n\r\n<script setup lang=\"ts\">\r\nimport { ElCol, ElFormItem } from 'element-plus'\r\nimport type { DiyItemProps } from './DiyItem'\r\nimport { useFormItemSpan, useFormItemRules } from '../hooks'\r\n\r\ndefineOptions({ name: 'OFormDiy', inheritAttrs: false })\r\n\r\nconst { name, label, labelWidth, required } = defineProps<DiyItemProps>()\r\nconst normalizedSpan = useFormItemSpan()\r\nconst normalizedRules = useFormItemRules()\r\n</script>\r\n","<template>\r\n <el-col :span=\"normalizedSpan\">\r\n <el-form-item :prop=\"name\" :label=\"label\" :label-width=\"labelWidth\" :required=\"required\" :rules=\"normalizedRules\">\r\n <el-dropdown ref=\"dropdown\" :trigger=\"'click'\" @visible-change=\"onVisibleChange\" style=\"width: 100%\">\r\n <el-input\r\n v-model=\"elModel\"\r\n :maxlength=\"maxlength\"\r\n :placeholder=\"placeholder\"\r\n :disabled=\"disabled\"\r\n :readonly=\"readonly\"\r\n @input=\"onInput\"\r\n @keydown=\"onKeydown\"\r\n @change=\"onChange\"\r\n :suffix-icon=\"Search\"\r\n />\r\n <template #dropdown> <slot></slot> </template>\r\n </el-dropdown>\r\n </el-form-item>\r\n </el-col>\r\n</template>\r\n\r\n<script setup lang=\"ts\">\r\nimport { ElCol, ElFormItem, ElInput, ElDropdown } from 'element-plus'\r\nimport { Search } from '@element-plus/icons-vue'\r\nimport { KeydownHandler, LovContext, lovContextKey, type LovInputProps } from './LovInput'\r\nimport { useFormItemSpan, useFormItemRules, useFormItemStringModel, useFormContext } from '../hooks'\r\nimport { provide, reactive, ref, useTemplateRef } from 'vue'\r\nimport { isString } from 'lodash-es'\r\n\r\ndefineOptions({ name: 'OFormLov', inheritAttrs: false })\r\n\r\nconst { name, label, labelWidth, required, maxlength, placeholder, disabled, readonly, fillMapping } = defineProps<LovInputProps>()\r\nconst normalizedSpan = useFormItemSpan()\r\nconst normalizedRules = useFormItemRules()\r\nconst elModel = useFormItemStringModel()\r\nconst formContext = useFormContext()!\r\n\r\nconst visible = ref(false)\r\nconst onVisibleChange = (val: boolean) => {\r\n visible.value = val\r\n}\r\n\r\nconst changed = ref(false)\r\nconst onInput = () => {\r\n if (!changed.value) {\r\n changed.value = true\r\n }\r\n\r\n if (!visible.value) {\r\n dropdownRef.value?.handleOpen()\r\n }\r\n}\r\n\r\nlet keydownHandler: KeydownHandler | undefined\r\nconst registerKeydownHandler: LovContext['registerKeydownHandler'] = (handler) => {\r\n keydownHandler = handler\r\n}\r\n\r\nconst onKeydown = (e: any) => {\r\n const fallthroughCodes = ['ArrowUp', 'ArrowDown', 'ArrowLeft', 'ArrowRight', 'Enter', 'Space']\r\n\r\n if (fallthroughCodes.indexOf(e.code) > -1) {\r\n if (visible.value) {\r\n keydownHandler && keydownHandler(e.code)\r\n }\r\n e.stopPropagation()\r\n }\r\n\r\n const triggerCodes = ['ArrowUp', 'ArrowDown']\r\n if (triggerCodes.indexOf(e.code) > -1 && !visible.value) {\r\n dropdownRef.value?.handleOpen()\r\n }\r\n}\r\n\r\nconst onChange = () => {\r\n if (!changed.value) {\r\n return\r\n }\r\n\r\n if (isString(fillMapping)) {\r\n const data: Record<string, any> = {}\r\n\r\n const pairs = fillMapping.split(',')\r\n for (let i = 0; i < pairs.length; i++) {\r\n const dstName = pairs[i].split(':')[0].trim()\r\n data[dstName] = undefined\r\n }\r\n\r\n formContext.updateModelValueMulti(data)\r\n }\r\n}\r\n\r\nconst dropdownRef = useTemplateRef('dropdown')\r\nconst backfill: LovContext['backfill'] = (params) => {\r\n dropdownRef.value?.handleClose()\r\n\r\n if (isString(fillMapping)) {\r\n const data: Record<string, any> = {}\r\n\r\n const pairs = fillMapping.split(',')\r\n for (let i = 0; i < pairs.length; i++) {\r\n const dstName = pairs[i].split(':')[0].trim()\r\n const srcName = pairs[i].split(':')[1].trim()\r\n const srcValue = params[srcName]\r\n data[dstName] = srcValue\r\n }\r\n\r\n formContext.updateModelValueMulti(data)\r\n } else {\r\n fillMapping && fillMapping(params)\r\n }\r\n\r\n if (changed.value) {\r\n changed.value = false\r\n }\r\n}\r\n\r\nprovide(\r\n lovContextKey,\r\n reactive({\r\n lovValue: elModel,\r\n backfill,\r\n registerKeydownHandler,\r\n })\r\n)\r\n</script>\r\n","import { withInstall } from '../_util'\r\n\r\nimport Form from './Form.vue'\r\nimport StringInput from './StringInput/StringInput.vue'\r\nimport PasswordInput from './PasswordInput/PasswordInput.vue'\r\nimport Textarea from './Textarea/Textarea.vue'\r\nimport SingleSelect from './SingleSelect/SingleSelect.vue'\r\nimport MultiSelect from './MultiSelect/MultiSelect.vue'\r\nimport RadioGroup from './RadioGroup/RadioGroup.vue'\r\nimport CheckboxGroup from './CheckboxGroup/CheckboxGroup.vue'\r\nimport Checkbox from './Checkbox/Checkbox.vue'\r\nimport Switch from './Switch/Switch.vue'\r\nimport DateInput from './DateInput/DateInput.vue'\r\nimport FileInput from './FileInput/FileInput.vue'\r\nimport ButtonGroup from './ButtonGroup/ButtonGroup.vue'\r\nimport DiyItem from './DiyItem/DiyItem.vue'\r\nimport LovInput from './LovInput/LovInput.vue'\r\n\r\nexport default withInstall<\r\n typeof Form,\r\n {\r\n StringInput: typeof StringInput\r\n PasswordInput: typeof PasswordInput\r\n Textarea: typeof Textarea\r\n SingleSelect: typeof SingleSelect\r\n MultiSelect: typeof MultiSelect\r\n RadioGroup: typeof RadioGroup\r\n CheckboxGroup: typeof CheckboxGroup\r\n Checkbox: typeof Checkbox\r\n Switch: typeof Switch\r\n DateInput: typeof DateInput\r\n FileInput: typeof FileInput\r\n ButtonGroup: typeof ButtonGroup\r\n DiyItem: typeof DiyItem\r\n LovInput: typeof LovInput\r\n }\r\n>(Form, {\r\n StringInput,\r\n PasswordInput,\r\n Textarea,\r\n SingleSelect,\r\n MultiSelect,\r\n RadioGroup,\r\n CheckboxGroup,\r\n Checkbox,\r\n Switch,\r\n DateInput,\r\n FileInput,\r\n ButtonGroup,\r\n DiyItem,\r\n LovInput,\r\n})\r\n\r\nexport * from './Form'\r\nexport * from './StringInput'\r\nexport * from './PasswordInput'\r\nexport * from './Textarea'\r\nexport * from './SingleSelect'\r\nexport * from './MultiSelect'\r\nexport * from './RadioGroup'\r\nexport * from './CheckboxGroup'\r\nexport * from './Checkbox'\r\nexport * from './Switch'\r\nexport * from './DateInput'\r\nexport * from './FileInput'\r\nexport * from './ButtonGroup'\r\nexport * from './DiyItem'\r\nexport * from './LovInput'\r\n"],"names":["emit","__emit","updateModelValue","name","value","__props","OrionError","updateModelValueMulti","data","modelKeys","dataKeys","diff","difference","isEmpty","formRef","useTemplateRef","__expose","provide","formContextKey","reactive","toRef","normalizedSpan","useFormItemSpan","normalizedRules","useFormItemRules","elModel","useFormItemStringModel","normalizedDisabled","useFormItemDisabled","normalizedCode","useFormItemCode","content","computed","getSingleCodeContent","useFormItemMultiModel","formContext","useFormContext","getMultiCodeContent","useFormItemBooleanModel","isTimePicker","normalizedSourceFormat","dateType","picker","isDate","isString","dayjsObj","dayjs","newValue","watch","file","ref","fileRef","onMounted","event","_a","style","visible","onVisibleChange","val","changed","onInput","dropdownRef","keydownHandler","registerKeydownHandler","handler","onKeydown","e","onChange","pairs","i","dstName","lovContextKey","params","srcName","srcValue","index","withInstall","Form","StringInput","PasswordInput","Textarea","SingleSelect","MultiSelect","RadioGroup","CheckboxGroup","Checkbox","Switch","DateInput","FileInput","ButtonGroup","DiyItem","LovInput"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAmBA,UAAMA,IAAOC,GAEPC,IAAmB,CAACC,GAAcC,MAAe;AACjD,UAAA,CAAC,OAAO,KAAKC,EAAA,UAAU,EAAE,SAASF,CAAI;AACxC,cAAM,IAAIG,EAAW,kBAAkBH,CAAI,GAAG;AAE3C,MAAAH,EAAA,qBAAqB,EAAE,GAAGK,cAAY,CAACF,CAAI,GAAGC,EAAA,CAAO;AAAA,IAAA,GAGtDG,IAAwB,CAACC,MAA8B;AAC3D,YAAMC,IAAY,OAAO,KAAKJ,EAAA,UAAU,GAClCK,IAAW,OAAO,KAAKF,CAAI,GAC3BG,IAAOC,GAAWF,GAAUD,CAAS;AACvC,UAAA,CAACI,GAAQF,CAAI;AACf,cAAM,IAAIL,EAAW,kBAAkBK,EAAK,KAAK,GAAG,CAAC,GAAG;AAE1D,MAAAX,EAAK,qBAAqB,EAAE,GAAGK,EAAU,YAAE,GAAGG,GAAM;AAAA,IAAA,GAGhDM,IAAUC,EAAe,MAAM;AAMxB,WAAAC,EAAA;AAAA,MACX,UALuC,YAChC,MAAMF,EAAQ,MAAO;IAI5B,CACD,GAEDG;AAAA,MACEC;AAAA,MACAC,EAAS;AAAA,QACP,YAAYC,EAAM,MAAMf,EAAU,UAAA;AAAA,QAClC,kBAAAH;AAAA,QACA,uBAAAK;AAAA,QACA,OAAOa,EAAM,MAAMf,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AY,UAAZ,QAAAP,EAAmB,eAEfV,EAASvC,EAAA,WAAW,GAAG;AACzB,kBAAMG,IAA4B,CAAA,GAE5B4D,IAAQ/D,EAAA,YAAY,MAAM,GAAG;AACnC,qBAASgE,IAAI,GAAGA,IAAID,EAAM,QAAQC,KAAK;AAC/B,oBAAAC,IAAUF,EAAMC,CAAC,EAAE,MAAM,GAAG,EAAE,CAAC,EAAE,QACjCI,KAAUL,EAAMC,CAAC,EAAE,MAAM,GAAG,EAAE,CAAC,EAAE,QACjCK,KAAWF,EAAOC,EAAO;AAC/B,cAAAjE,EAAK8D,CAAO,IAAII;AAAA,YAClB;AAEA,YAAAvC,EAAY,sBAAsB3B,CAAI;AAAA,UAAA;AAE3B,YAAAH,EAAA,eAAIA,EAAW,YAACmE,CAAM;AAGnC,UAAIb,EAAQ,UACVA,EAAQ,QAAQ;AAAA,QAClB;AAAA,QAQE,wBAAAI;AAAA,MAAA,CACD;AAAA,IAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ICzGYY,KAAAC,GAkBbC,IAAM;AAAA,EAAA,aACNC;AAAAA,EAAA,eACAC;AAAAA,EAAA,UACAC;AAAAA,EAAA,cACAC;AAAAA,EAAA,aACAC;AAAAA,EAAA,YACAC;AAAAA,EAAA,eACAC;AAAAA,EAAA,UACAC;AAAAA,EAAA,QACAC;AAAAA,EAAA,WACAC;AAAAA,EAAA,WACAC;AAAAA,EAAA,aACAC;AAAAA,EAAA,SACAC;AAAAA,EAAA,UACAC;AACF,CAAC;"}
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../src/components/Form/Form.vue","../../../src/components/Form/StringInput/StringInput.vue","../../../src/components/Form/PasswordInput/PasswordInput.vue","../../../src/components/Form/Textarea/Textarea.vue","../../../src/components/Form/SingleSelect/SingleSelect.vue","../../../src/components/Form/MultiSelect/MultiSelect.vue","../../../src/components/Form/RadioGroup/RadioGroup.vue","../../../src/components/Form/CheckboxGroup/CheckboxGroup.vue","../../../src/components/Form/Checkbox/Checkbox.vue","../../../src/components/Form/Switch/Switch.vue","../../../src/components/Form/DateInput/DateInput.vue","../../../src/components/Form/FileInput/FileInput.vue","../../../src/components/Form/ButtonGroup/ButtonGroup.vue","../../../src/components/Form/DiyItem/DiyItem.vue","../../../src/components/Form/LovInput/LovInput.vue","../../../src/components/Form/NumberInput/NumberInput.vue","../../../src/components/Form/index.ts"],"sourcesContent":["<template>\r\n <el-form ref=\"form\" :model=\"modelValue\" :rules=\"rules\" :label-width=\"itemLabelWidth\" :disabled=\"disabled\">\r\n <el-row :gutter=\"16\">\r\n <slot></slot>\r\n </el-row>\r\n </el-form>\r\n</template>\r\n\r\n<script setup lang=\"ts\">\r\nimport { provide, reactive, toRef, useTemplateRef } from 'vue'\r\nimport { ElForm, ElRow } from 'element-plus'\r\nimport { type FormProps, type FormExpose, formContextKey } from './Form'\r\nimport OrionError from '../../error/OrionError'\r\nimport { difference, isEmpty } from 'lodash-es'\r\n\r\ndefineOptions({ name: 'OForm', inheritAttrs: false })\r\n\r\nconst { rules, itemSpan = 6, itemLabelWidth = 'auto', disabled = false, modelValue } = defineProps<FormProps>()\r\n\r\nconst emit = defineEmits(['update:modelValue'])\r\n\r\nconst updateModelValue = (name: string, value: any) => {\r\n if (!Object.keys(modelValue).includes(name)) {\r\n throw new OrionError(`modelValue中不存在[${name}]`)\r\n }\r\n emit('update:modelValue', { ...modelValue, [name]: value })\r\n}\r\n\r\nconst updateModelValueMulti = (data: Record<string, any>) => {\r\n const modelKeys = Object.keys(modelValue)\r\n const dataKeys = Object.keys(data)\r\n const diff = difference(dataKeys, modelKeys)\r\n if (!isEmpty(diff)) {\r\n throw new OrionError(`modelValue中不存在[${diff.join(',')}]`)\r\n }\r\n emit('update:modelValue', { ...modelValue, ...data })\r\n}\r\n\r\nconst formRef = useTemplateRef('form')\r\n\r\nconst validate: FormExpose['validate'] = async () => {\r\n return await formRef.value!.validate()\r\n}\r\n\r\ndefineExpose({\r\n validate,\r\n})\r\n\r\nprovide(\r\n formContextKey,\r\n reactive({\r\n modelValue: toRef(() => modelValue),\r\n updateModelValue,\r\n updateModelValueMulti,\r\n rules: toRef(() => rules),\r\n itemSpan: toRef(() => itemSpan),\r\n disabled: toRef(() => disabled),\r\n })\r\n)\r\n</script>\r\n","<template>\r\n <el-col :span=\"normalizedSpan\">\r\n <el-form-item :prop=\"name\" :label=\"label\" :label-width=\"labelWidth\" :required=\"required\" :rules=\"normalizedRules\">\r\n <el-input v-model=\"elModel\" :maxlength=\"maxlength\" :placeholder=\"placeholder\" :disabled=\"disabled\" :readonly=\"readonly\" />\r\n </el-form-item>\r\n </el-col>\r\n</template>\r\n\r\n<script setup lang=\"ts\">\r\nimport { ElCol, ElFormItem, ElInput } from 'element-plus'\r\nimport type { StringInputProps } from './StringInput'\r\nimport { useFormItemSpan, useFormItemRules, useFormItemStringModel } from '../hooks'\r\n\r\ndefineOptions({ name: 'OFormString', inheritAttrs: false })\r\n\r\nconst { name, label, labelWidth, required, maxlength, placeholder, disabled, readonly } = defineProps<StringInputProps>()\r\nconst normalizedSpan = useFormItemSpan()\r\nconst normalizedRules = useFormItemRules()\r\nconst elModel = useFormItemStringModel()\r\n</script>\r\n","<template>\r\n <el-col :span=\"normalizedSpan\">\r\n <el-form-item :prop=\"name\" :label=\"label\" :label-width=\"labelWidth\" :required=\"required\" :rules=\"normalizedRules\">\r\n <el-input v-model=\"elModel\" :maxlength=\"maxlength\" :placeholder=\"placeholder\" :disabled=\"disabled\" :readonly=\"readonly\" type=\"password\" />\r\n </el-form-item>\r\n </el-col>\r\n</template>\r\n\r\n<script setup lang=\"ts\">\r\nimport { ElCol, ElFormItem, ElInput } from 'element-plus'\r\nimport type { PasswordInputProps } from './PasswordInput'\r\nimport { useFormItemSpan, useFormItemRules, useFormItemStringModel } from '../hooks'\r\n\r\ndefineOptions({ name: 'OFormPassword', inheritAttrs: false })\r\n\r\nconst { name, label, labelWidth, required, maxlength, placeholder, disabled, readonly } = defineProps<PasswordInputProps>()\r\nconst normalizedSpan = useFormItemSpan()\r\nconst normalizedRules = useFormItemRules()\r\nconst elModel = useFormItemStringModel()\r\n</script>\r\n","<template>\r\n <el-col :span=\"normalizedSpan\">\r\n <el-form-item :prop=\"name\" :label=\"label\" :label-width=\"labelWidth\" :required=\"required\" :rules=\"normalizedRules\">\r\n <el-input\r\n v-model=\"elModel\"\r\n :maxlength=\"maxlength\"\r\n :placeholder=\"placeholder\"\r\n :disabled=\"disabled\"\r\n :readonly=\"readonly\"\r\n type=\"textarea\"\r\n :rows=\"rows\"\r\n :resize=\"'none'\"\r\n />\r\n </el-form-item>\r\n </el-col>\r\n</template>\r\n\r\n<script setup lang=\"ts\">\r\nimport { ElCol, ElFormItem, ElInput } from 'element-plus'\r\nimport type { TextareaProps } from './Textarea'\r\nimport { useFormItemSpan, useFormItemRules, useFormItemStringModel } from '../hooks'\r\n\r\ndefineOptions({ name: 'OFormTextarea', inheritAttrs: false })\r\n\r\nconst { name, label, labelWidth, required, maxlength, placeholder, disabled, readonly, rows } = defineProps<TextareaProps>()\r\nconst normalizedSpan = useFormItemSpan()\r\nconst normalizedRules = useFormItemRules()\r\nconst elModel = useFormItemStringModel()\r\n</script>\r\n","<template>\r\n <el-col :span=\"normalizedSpan\">\r\n <el-form-item :prop=\"name\" :label=\"label\" :label-width=\"labelWidth\" :required=\"required\" :rules=\"normalizedRules\">\r\n <el-input v-if=\"normalizedDisabled\" :model-value=\"content\" :placeholder=\"placeholder\" :disabled=\"true\" :readonly=\"true\" />\r\n <el-select v-else v-model=\"elModel\" :placeholder=\"placeholder\" :clearable=\"clearable\" :filterable=\"filterable\">\r\n <el-option v-for=\"codeItem in normalizedCode\" :key=\"codeItem.value\" :label=\"codeItem.content\" :value=\"codeItem.value\" />\r\n </el-select>\r\n </el-form-item>\r\n </el-col>\r\n</template>\r\n\r\n<script setup lang=\"ts\">\r\nimport { computed } from 'vue'\r\nimport { ElCol, ElFormItem, ElInput, ElSelect, ElOption } from 'element-plus'\r\nimport type { SingleSelectProps } from './SingleSelect'\r\nimport { useFormItemSpan, useFormItemRules, useFormItemDisabled, useFormItemCode, useFormItemStringModel } from '../hooks'\r\nimport { getSingleCodeContent } from '../utils'\r\n\r\ndefineOptions({ name: 'OFormSingleselect', inheritAttrs: false })\r\n\r\nconst { name, label, labelWidth, required, placeholder, clearable, filterable } = defineProps<SingleSelectProps>()\r\nconst normalizedSpan = useFormItemSpan()\r\nconst normalizedRules = useFormItemRules()\r\nconst normalizedDisabled = useFormItemDisabled()\r\nconst normalizedCode = useFormItemCode()\r\nconst elModel = useFormItemStringModel()\r\nconst content = computed(() => getSingleCodeContent(normalizedCode.value, elModel.value))\r\n</script>\r\n","<template>\r\n <el-col :span=\"normalizedSpan\">\r\n <el-form-item :prop=\"name\" :label=\"label\" :label-width=\"labelWidth\" :required=\"required\" :rules=\"normalizedRules\">\r\n <el-input v-if=\"normalizedDisabled\" :model-value=\"content\" :placeholder=\"placeholder\" :disabled=\"true\" :readonly=\"true\" />\r\n <el-select v-else v-model=\"elModel\" :placeholder=\"placeholder\" multiple>\r\n <el-option v-for=\"codeItem in normalizedCode\" :key=\"codeItem.value\" :label=\"codeItem.content\" :value=\"codeItem.value\" />\r\n </el-select>\r\n </el-form-item>\r\n </el-col>\r\n</template>\r\n\r\n<script setup lang=\"ts\">\r\nimport { computed } from 'vue'\r\nimport { ElCol, ElFormItem, ElInput, ElSelect, ElOption } from 'element-plus'\r\nimport type { MultiSelectProps } from './MultiSelect'\r\nimport { useFormContext, useFormItemSpan, useFormItemRules, useFormItemDisabled, useFormItemCode, useFormItemMultiModel } from '../hooks'\r\nimport { getMultiCodeContent } from '../utils'\r\n\r\ndefineOptions({ name: 'OFormMultiselect', inheritAttrs: false })\r\n\r\nconst { name, label, labelWidth, required, placeholder } = defineProps<MultiSelectProps>()\r\nconst normalizedSpan = useFormItemSpan()\r\nconst normalizedRules = useFormItemRules()\r\nconst normalizedDisabled = useFormItemDisabled()\r\nconst normalizedCode = useFormItemCode()\r\nconst elModel = useFormItemMultiModel()\r\nconst formContext = useFormContext()!\r\nconst content = computed(() => getMultiCodeContent(normalizedCode.value, formContext.modelValue[name]))\r\n</script>\r\n","<template>\r\n <el-col :span=\"normalizedSpan\">\r\n <el-form-item :prop=\"name\" :label=\"label\" :label-width=\"labelWidth\" :required=\"required\" :rules=\"normalizedRules\">\r\n <el-radio-group v-model=\"elModel\" :disabled=\"disabled\">\r\n <el-radio v-for=\"codeItem in normalizedCode\" :key=\"codeItem.value\" :value=\"codeItem.value\">\r\n {{ codeItem.content }}\r\n </el-radio>\r\n </el-radio-group>\r\n </el-form-item>\r\n </el-col>\r\n</template>\r\n\r\n<script setup lang=\"ts\">\r\nimport { ElCol, ElFormItem, ElRadioGroup, ElRadio } from 'element-plus'\r\nimport type { RadioGroupProps } from './RadioGroup'\r\nimport { useFormItemSpan, useFormItemRules, useFormItemCode, useFormItemStringModel } from '../hooks'\r\n\r\ndefineOptions({ name: 'OFormRadiogroup', inheritAttrs: false })\r\n\r\nconst { name, label, labelWidth, required, disabled } = defineProps<RadioGroupProps>()\r\nconst normalizedSpan = useFormItemSpan()\r\nconst normalizedRules = useFormItemRules()\r\nconst normalizedCode = useFormItemCode()\r\nconst elModel = useFormItemStringModel()\r\n</script>\r\n","<template>\r\n <el-col :span=\"normalizedSpan\">\r\n <el-form-item :prop=\"name\" :label=\"label\" :label-width=\"labelWidth\" :required=\"required\" :rules=\"normalizedRules\">\r\n <el-checkbox-group v-model=\"elModel\" :disabled=\"disabled\">\r\n <el-checkbox v-for=\"codeItem in normalizedCode\" :key=\"codeItem.value\" :label=\"codeItem.content\" :value=\"codeItem.value\" />\r\n </el-checkbox-group>\r\n </el-form-item>\r\n </el-col>\r\n</template>\r\n\r\n<script setup lang=\"ts\">\r\nimport { ElCol, ElFormItem, ElCheckboxGroup, ElCheckbox } from 'element-plus'\r\nimport type { CheckboxGroupProps } from './CheckboxGroup'\r\nimport { useFormItemSpan, useFormItemRules, useFormItemCode, useFormItemMultiModel } from '../hooks'\r\n\r\ndefineOptions({ name: 'OFormCheckboxgroup', inheritAttrs: false })\r\n\r\nconst { name, label, labelWidth, required, disabled } = defineProps<CheckboxGroupProps>()\r\nconst normalizedSpan = useFormItemSpan()\r\nconst normalizedRules = useFormItemRules()\r\nconst normalizedCode = useFormItemCode()\r\nconst elModel = useFormItemMultiModel()\r\n</script>\r\n","<template>\r\n <el-col :span=\"normalizedSpan\">\r\n <el-form-item :prop=\"name\" :label=\"label\" :label-width=\"labelWidth\" :rules=\"rules\">\r\n <el-checkbox v-model=\"elModel\" :disabled=\"disabled\"></el-checkbox>\r\n </el-form-item>\r\n </el-col>\r\n</template>\r\n\r\n<script setup lang=\"ts\">\r\nimport { ElCol, ElFormItem, ElCheckbox } from 'element-plus'\r\nimport type { CheckboxProps } from './Checkbox'\r\nimport { useFormItemBooleanModel, useFormItemSpan } from '../hooks'\r\n\r\ndefineOptions({ name: 'OFormCheckbox', inheritAttrs: false })\r\n\r\nconst { name, label, labelWidth, rules, disabled } = defineProps<CheckboxProps>()\r\nconst normalizedSpan = useFormItemSpan()\r\nconst elModel = useFormItemBooleanModel()\r\n</script>\r\n","<template>\r\n <el-col :span=\"normalizedSpan\">\r\n <el-form-item :prop=\"name\" :label=\"label\" :label-width=\"labelWidth\" :rules=\"rules\">\r\n <el-switch v-model=\"elModel\" :disabled=\"disabled\" />\r\n </el-form-item>\r\n </el-col>\r\n</template>\r\n\r\n<script setup lang=\"ts\">\r\nimport { ElCol, ElFormItem, ElSwitch } from 'element-plus'\r\nimport type { SwitchProps } from './Switch'\r\nimport { useFormItemBooleanModel, useFormItemSpan } from '../hooks'\r\n\r\ndefineOptions({ name: 'OFormSwitch', inheritAttrs: false })\r\n\r\nconst { name, label, labelWidth, rules, disabled } = defineProps<SwitchProps>()\r\nconst normalizedSpan = useFormItemSpan()\r\nconst elModel = useFormItemBooleanModel()\r\n</script>\r\n","<template>\r\n <el-col :span=\"normalizedSpan\">\r\n <el-form-item :prop=\"name\" :label=\"label\" :label-width=\"labelWidth\" :required=\"required\" :rules=\"normalizedRules\">\r\n <el-time-picker\r\n v-if=\"isTimePicker\"\r\n v-model=\"elModel\"\r\n :placeholder=\"placeholder\"\r\n :disabled=\"disabled\"\r\n :readonly=\"readonly\"\r\n :editable=\"editable\"\r\n :clearable=\"clearable\"\r\n :format=\"normalizedSourceFormat\"\r\n arrow-control\r\n style=\"width: 100%\"\r\n />\r\n <el-date-picker\r\n v-else\r\n v-model=\"elModel\"\r\n :placeholder=\"placeholder\"\r\n :disabled=\"disabled\"\r\n :readonly=\"readonly\"\r\n :editable=\"editable\"\r\n :clearable=\"clearable\"\r\n :type=\"dateType\"\r\n :format=\"normalizedSourceFormat\"\r\n style=\"width: 100%\"\r\n />\r\n </el-form-item>\r\n </el-col>\r\n</template>\r\n\r\n<script setup lang=\"ts\">\r\nimport { computed } from 'vue'\r\nimport { ElCol, ElFormItem, ElDatePicker, ElTimePicker, dayjs } from 'element-plus'\r\nimport type { DateInputProps } from './DateInput'\r\nimport { useFormContext, useFormItemSpan, useFormItemRules } from '../hooks'\r\nimport { isDate, isString } from 'lodash-es'\r\nimport OrionError from '../../../error/OrionError'\r\n\r\ndefineOptions({ name: 'OFormDate', inheritAttrs: false })\r\n\r\nconst {\r\n name,\r\n label,\r\n labelWidth,\r\n required,\r\n placeholder,\r\n disabled,\r\n readonly,\r\n editable = true,\r\n clearable = true,\r\n format = 'YYYY-MM-DD',\r\n sourceFormat,\r\n} = defineProps<DateInputProps>()\r\nconst normalizedSpan = useFormItemSpan()\r\nconst normalizedRules = useFormItemRules()\r\n\r\nconst isTimePicker = computed(() => format.startsWith('H') || format.startsWith('h') || format.startsWith('m') || format.startsWith('s'))\r\n\r\nconst normalizedSourceFormat = computed(() => {\r\n if (sourceFormat) {\r\n return sourceFormat\r\n }\r\n if (isTimePicker.value) {\r\n return 'HH:mm:ss'\r\n } else {\r\n return 'YYYY-MM-DD'\r\n }\r\n})\r\n\r\nconst dateType = computed(() => {\r\n let picker: 'date' | 'year' | 'month' | 'datetime' = 'date'\r\n\r\n // 配置年 yyyy指年 YYYY指周年,年末年初的值可能有所变化\r\n if (format.indexOf('y') > -1 || format.indexOf('Y') > -1) {\r\n picker = 'year'\r\n }\r\n\r\n // 配置月,M指月份,m指分钟\r\n if (format.indexOf('M') > -1) {\r\n picker = 'month'\r\n }\r\n\r\n // 配置日,d指星期,D指月的天,DDD指年的天\r\n if (format.indexOf('d') > -1 || format.indexOf('D') > -1) {\r\n picker = 'date'\r\n }\r\n\r\n // 配置小时,H指24小时制(0~23),k指24小时制(1~24),h指12小时制,m指分钟,s指秒,S指小数秒\r\n if (\r\n format.indexOf('H') > -1 ||\r\n format.indexOf('h') > -1 ||\r\n format.indexOf('k') > -1 ||\r\n format.indexOf('m') > -1 ||\r\n format.indexOf('s') > -1 ||\r\n format.indexOf('S') > -1\r\n ) {\r\n picker = 'datetime'\r\n }\r\n\r\n return picker\r\n})\r\n\r\nconst formContext = useFormContext()!\r\nconst elModel = computed<Date | undefined>({\r\n get: () => {\r\n const value = formContext.modelValue[name]\r\n if (!value) {\r\n return undefined\r\n }\r\n if (isDate(value)) {\r\n return value as Date\r\n } else if (isString(value)) {\r\n const dayjsObj = dayjs(value, normalizedSourceFormat.value, true)\r\n if (!dayjsObj.isValid()) {\r\n throw new OrionError(`日期输入框的值无效,不符合${normalizedSourceFormat.value}格式`)\r\n }\r\n return dayjsObj.toDate()\r\n } else {\r\n throw new OrionError('日期输入框的值只能为字符串或日期类型')\r\n }\r\n },\r\n set: (newValue) => {\r\n if (sourceFormat) {\r\n if (!newValue) {\r\n formContext.updateModelValue(name, '')\r\n } else {\r\n formContext.updateModelValue(name, dayjs(newValue).format(normalizedSourceFormat.value))\r\n }\r\n } else {\r\n if (!newValue) {\r\n formContext.updateModelValue(name, undefined)\r\n } else {\r\n formContext.updateModelValue(name, newValue)\r\n }\r\n }\r\n },\r\n})\r\n</script>\r\n","<template>\r\n <el-col :span=\"normalizedSpan\">\r\n <el-form-item :prop=\"name\" :label=\"label\" :label-width=\"labelWidth\" :required=\"required\" :rules=\"normalizedRules\">\r\n <el-input ref=\"inputRef\" v-model=\"file\" :disabled=\"disabled\" type=\"file\" :validate-event=\"false\" />\r\n </el-form-item>\r\n </el-col>\r\n</template>\r\n\r\n<script setup lang=\"ts\">\r\nimport { onMounted, ref, useTemplateRef, watch } from 'vue'\r\nimport { ElCol, ElFormItem, ElInput } from 'element-plus'\r\nimport type { FileInputProps } from './FileInput'\r\nimport { useFormItemSpan, useFormItemRules, useFormItemStringModel } from '../hooks'\r\n\r\ndefineOptions({ name: 'OFormFile', inheritAttrs: false })\r\n\r\nconst { name, label, labelWidth, required, disabled } = defineProps<FileInputProps>()\r\nconst normalizedSpan = useFormItemSpan()\r\nconst normalizedRules = useFormItemRules()\r\nconst elModel = useFormItemStringModel()\r\nwatch(elModel, () => {\r\n if (!elModel.value) {\r\n file.value = ''\r\n }\r\n})\r\n\r\nconst file = ref('')\r\nconst fileRef = useTemplateRef('inputRef')\r\nonMounted(() => {\r\n fileRef.value!.input!.onchange = (event) => {\r\n //@ts-ignore\r\n elModel.value = event?.target?.files[0]\r\n }\r\n file.value = ''\r\n})\r\n</script>\r\n","<template>\r\n <el-col :span=\"normalizedSpan\" :style=\"style\">\r\n <space :gutter=\"gutter\" style=\"margin-bottom: 18px\"> <slot></slot> </space>\r\n </el-col>\r\n</template>\r\n\r\n<script setup lang=\"ts\">\r\nimport { ElCol } from 'element-plus'\r\nimport type { ButtonGroupProps } from './ButtonGroup'\r\nimport Space from '../../Space'\r\nimport { useFormItemSpan } from '../hooks'\r\nimport { computed, CSSProperties } from 'vue'\r\n\r\ndefineOptions({ name: 'OFormButtongroup', inheritAttrs: false })\r\n\r\nconst { gutter, align = 'right' } = defineProps<ButtonGroupProps>()\r\nconst style = computed<CSSProperties>(() => {\r\n return {\r\n textAlign: align,\r\n }\r\n})\r\n\r\nconst normalizedSpan = useFormItemSpan()\r\n</script>\r\n","<template>\r\n <el-col :span=\"normalizedSpan\">\r\n <el-form-item :prop=\"name\" :label=\"label\" :label-width=\"labelWidth\" :required=\"required\" :rules=\"normalizedRules\">\r\n <slot></slot>\r\n </el-form-item>\r\n </el-col>\r\n</template>\r\n\r\n<script setup lang=\"ts\">\r\nimport { ElCol, ElFormItem } from 'element-plus'\r\nimport type { DiyItemProps } from './DiyItem'\r\nimport { useFormItemSpan, useFormItemRules } from '../hooks'\r\n\r\ndefineOptions({ name: 'OFormDiy', inheritAttrs: false })\r\n\r\nconst { name, label, labelWidth, required } = defineProps<DiyItemProps>()\r\nconst normalizedSpan = useFormItemSpan()\r\nconst normalizedRules = useFormItemRules()\r\n</script>\r\n","<template>\r\n <el-col :span=\"normalizedSpan\">\r\n <el-form-item :prop=\"name\" :label=\"label\" :label-width=\"labelWidth\" :required=\"required\" :rules=\"normalizedRules\">\r\n <el-dropdown ref=\"dropdown\" :trigger=\"'click'\" @visible-change=\"onVisibleChange\" style=\"width: 100%\">\r\n <el-input\r\n v-model=\"elModel\"\r\n :maxlength=\"maxlength\"\r\n :placeholder=\"placeholder\"\r\n :disabled=\"disabled\"\r\n :readonly=\"readonly\"\r\n @input=\"onInput\"\r\n @keydown=\"onKeydown\"\r\n @change=\"onChange\"\r\n :suffix-icon=\"Search\"\r\n />\r\n <template #dropdown> <slot></slot> </template>\r\n </el-dropdown>\r\n </el-form-item>\r\n </el-col>\r\n</template>\r\n\r\n<script setup lang=\"ts\">\r\nimport { ElCol, ElFormItem, ElInput, ElDropdown } from 'element-plus'\r\nimport { Search } from '@element-plus/icons-vue'\r\nimport { KeydownHandler, LovContext, lovContextKey, type LovInputProps } from './LovInput'\r\nimport { useFormItemSpan, useFormItemRules, useFormItemStringModel, useFormContext } from '../hooks'\r\nimport { provide, reactive, ref, useTemplateRef } from 'vue'\r\nimport { isString } from 'lodash-es'\r\n\r\ndefineOptions({ name: 'OFormLov', inheritAttrs: false })\r\n\r\nconst { name, label, labelWidth, required, maxlength, placeholder, disabled, readonly, fillMapping } = defineProps<LovInputProps>()\r\nconst normalizedSpan = useFormItemSpan()\r\nconst normalizedRules = useFormItemRules()\r\nconst elModel = useFormItemStringModel()\r\nconst formContext = useFormContext()!\r\n\r\nconst visible = ref(false)\r\nconst onVisibleChange = (val: boolean) => {\r\n visible.value = val\r\n}\r\n\r\nconst changed = ref(false)\r\nconst onInput = () => {\r\n if (!changed.value) {\r\n changed.value = true\r\n }\r\n\r\n if (!visible.value) {\r\n dropdownRef.value?.handleOpen()\r\n }\r\n}\r\n\r\nlet keydownHandler: KeydownHandler | undefined\r\nconst registerKeydownHandler: LovContext['registerKeydownHandler'] = (handler) => {\r\n keydownHandler = handler\r\n}\r\n\r\nconst onKeydown = (e: any) => {\r\n const fallthroughCodes = ['ArrowUp', 'ArrowDown', 'ArrowLeft', 'ArrowRight', 'Enter', 'Space']\r\n\r\n if (fallthroughCodes.indexOf(e.code) > -1) {\r\n if (visible.value) {\r\n keydownHandler && keydownHandler(e.code)\r\n }\r\n e.stopPropagation()\r\n }\r\n\r\n const triggerCodes = ['ArrowUp', 'ArrowDown']\r\n if (triggerCodes.indexOf(e.code) > -1 && !visible.value) {\r\n dropdownRef.value?.handleOpen()\r\n }\r\n}\r\n\r\nconst onChange = () => {\r\n if (!changed.value) {\r\n return\r\n }\r\n\r\n if (isString(fillMapping)) {\r\n const data: Record<string, any> = {}\r\n\r\n const pairs = fillMapping.split(',')\r\n for (let i = 0; i < pairs.length; i++) {\r\n const dstName = pairs[i].split(':')[0].trim()\r\n data[dstName] = undefined\r\n }\r\n\r\n formContext.updateModelValueMulti(data)\r\n }\r\n}\r\n\r\nconst dropdownRef = useTemplateRef('dropdown')\r\nconst backfill: LovContext['backfill'] = (params) => {\r\n dropdownRef.value?.handleClose()\r\n\r\n if (isString(fillMapping)) {\r\n const data: Record<string, any> = {}\r\n\r\n const pairs = fillMapping.split(',')\r\n for (let i = 0; i < pairs.length; i++) {\r\n const dstName = pairs[i].split(':')[0].trim()\r\n const srcName = pairs[i].split(':')[1].trim()\r\n const srcValue = params[srcName]\r\n data[dstName] = srcValue\r\n }\r\n\r\n formContext.updateModelValueMulti(data)\r\n } else {\r\n fillMapping && fillMapping(params)\r\n }\r\n\r\n if (changed.value) {\r\n changed.value = false\r\n }\r\n}\r\n\r\nprovide(\r\n lovContextKey,\r\n reactive({\r\n lovValue: elModel,\r\n backfill,\r\n registerKeydownHandler,\r\n })\r\n)\r\n</script>\r\n","<template>\r\n <el-col :span=\"normalizedSpan\">\r\n <el-form-item :prop=\"name\" :label=\"label\" :label-width=\"labelWidth\" :required=\"required\" :rules=\"normalizedRules\">\r\n <el-input-number\r\n v-model=\"elModel\"\r\n :placeholder=\"placeholder\"\r\n :disabled=\"disabled\"\r\n :readonly=\"readonly\"\r\n :min=\"min\"\r\n :max=\"max\"\r\n :step=\"step\"\r\n :step-strictly=\"stepStrictly\"\r\n :precision=\"precision\"\r\n :controls=\"controls\"\r\n :controls-position=\"controlsPosition\"\r\n style=\"width: 100%\"\r\n />\r\n </el-form-item>\r\n </el-col>\r\n</template>\r\n\r\n<script setup lang=\"ts\">\r\nimport { ElCol, ElFormItem, ElInputNumber } from 'element-plus'\r\nimport type { NumberInputProps } from './NumberInput'\r\nimport { useFormItemSpan, useFormItemRules, useFormContext } from '../hooks'\r\nimport { computed } from 'vue'\r\nimport { isNumber, isString, toNumber } from 'lodash-es'\r\nimport OrionError from '../../../error/OrionError'\r\n\r\ndefineOptions({ name: 'OFormNumber', inheritAttrs: false })\r\n\r\nconst {\r\n name,\r\n label,\r\n labelWidth,\r\n required,\r\n placeholder,\r\n disabled,\r\n readonly,\r\n min,\r\n max,\r\n step,\r\n stepStrictly,\r\n precision,\r\n controls = true,\r\n controlsPosition,\r\n} = defineProps<NumberInputProps>()\r\nconst normalizedSpan = useFormItemSpan()\r\nconst normalizedRules = useFormItemRules()\r\n\r\nconst formContext = useFormContext()!\r\nconst elModel = computed<number | undefined>({\r\n get: () => {\r\n const value = formContext.modelValue[name]\r\n if (!value) {\r\n return undefined\r\n }\r\n if (isNumber(value)) {\r\n return value\r\n } else if (isString(value)) {\r\n return toNumber(value)\r\n } else {\r\n throw new OrionError('数字输入框的值只能为字符串或数字类型')\r\n }\r\n },\r\n set: (newValue) => {\r\n if (!newValue) {\r\n formContext.updateModelValue(name, undefined)\r\n } else {\r\n formContext.updateModelValue(name, newValue)\r\n }\r\n },\r\n})\r\n</script>\r\n","import { withInstall } from '../_util'\r\n\r\nimport Form from './Form.vue'\r\nimport StringInput from './StringInput/StringInput.vue'\r\nimport PasswordInput from './PasswordInput/PasswordInput.vue'\r\nimport Textarea from './Textarea/Textarea.vue'\r\nimport SingleSelect from './SingleSelect/SingleSelect.vue'\r\nimport MultiSelect from './MultiSelect/MultiSelect.vue'\r\nimport RadioGroup from './RadioGroup/RadioGroup.vue'\r\nimport CheckboxGroup from './CheckboxGroup/CheckboxGroup.vue'\r\nimport Checkbox from './Checkbox/Checkbox.vue'\r\nimport Switch from './Switch/Switch.vue'\r\nimport DateInput from './DateInput/DateInput.vue'\r\nimport FileInput from './FileInput/FileInput.vue'\r\nimport ButtonGroup from './ButtonGroup/ButtonGroup.vue'\r\nimport DiyItem from './DiyItem/DiyItem.vue'\r\nimport LovInput from './LovInput/LovInput.vue'\r\nimport NumberInput from './NumberInput/NumberInput.vue'\r\n\r\nexport default withInstall<\r\n typeof Form,\r\n {\r\n StringInput: typeof StringInput\r\n PasswordInput: typeof PasswordInput\r\n Textarea: typeof Textarea\r\n SingleSelect: typeof SingleSelect\r\n MultiSelect: typeof MultiSelect\r\n RadioGroup: typeof RadioGroup\r\n CheckboxGroup: typeof CheckboxGroup\r\n Checkbox: typeof Checkbox\r\n Switch: typeof Switch\r\n DateInput: typeof DateInput\r\n FileInput: typeof FileInput\r\n ButtonGroup: typeof ButtonGroup\r\n DiyItem: typeof DiyItem\r\n LovInput: typeof LovInput\r\n NumberInput: typeof NumberInput\r\n }\r\n>(Form, {\r\n StringInput,\r\n PasswordInput,\r\n Textarea,\r\n SingleSelect,\r\n MultiSelect,\r\n RadioGroup,\r\n CheckboxGroup,\r\n Checkbox,\r\n Switch,\r\n DateInput,\r\n FileInput,\r\n ButtonGroup,\r\n DiyItem,\r\n LovInput,\r\n NumberInput,\r\n})\r\n\r\nexport * from './Form'\r\nexport * from './StringInput'\r\nexport * from './PasswordInput'\r\nexport * from './Textarea'\r\nexport * from './SingleSelect'\r\nexport * from './MultiSelect'\r\nexport * from './RadioGroup'\r\nexport * from './CheckboxGroup'\r\nexport * from './Checkbox'\r\nexport * from './Switch'\r\nexport * from './DateInput'\r\nexport * from './FileInput'\r\nexport * from './ButtonGroup'\r\nexport * from './DiyItem'\r\nexport * from './LovInput'\r\nexport * from './NumberInput'\r\n"],"names":["emit","__emit","updateModelValue","name","value","__props","OrionError","updateModelValueMulti","data","modelKeys","dataKeys","diff","difference","isEmpty","formRef","useTemplateRef","__expose","provide","formContextKey","reactive","toRef","normalizedSpan","useFormItemSpan","normalizedRules","useFormItemRules","elModel","useFormItemStringModel","normalizedDisabled","useFormItemDisabled","normalizedCode","useFormItemCode","content","computed","getSingleCodeContent","useFormItemMultiModel","formContext","useFormContext","getMultiCodeContent","useFormItemBooleanModel","isTimePicker","normalizedSourceFormat","dateType","picker","isDate","isString","dayjsObj","dayjs","newValue","watch","file","ref","fileRef","onMounted","event","_a","style","visible","onVisibleChange","val","changed","onInput","dropdownRef","keydownHandler","registerKeydownHandler","handler","onKeydown","e","onChange","pairs","i","dstName","lovContextKey","params","srcName","srcValue","isNumber","toNumber","index","withInstall","Form","StringInput","PasswordInput","Textarea","SingleSelect","MultiSelect","RadioGroup","CheckboxGroup","Checkbox","Switch","DateInput","FileInput","ButtonGroup","DiyItem","LovInput","NumberInput"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAmBA,UAAMA,IAAOC,GAEPC,IAAmB,CAACC,GAAcC,MAAe;AACjD,UAAA,CAAC,OAAO,KAAKC,EAAA,UAAU,EAAE,SAASF,CAAI;AACxC,cAAM,IAAIG,EAAW,kBAAkBH,C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wBAAAI;AAAA,MAAA,CACD;AAAA,IAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AC5EH,UAAM1C,IAAiBC,KACjBC,IAAkBC,KAElBW,IAAcC,KACdX,IAAUO,EAA6B;AAAA,MAC3C,KAAK,MAAM;AACT,cAAM5B,IAAQ+B,EAAY,WAAW9B,EAAA,IAAI;AACzC,YAAKD,GAGD;AAAA,cAAAuE,GAASvE,CAAK;AACT,mBAAAA;AACT,cAAWwC,EAASxC,CAAK;AACvB,mBAAOwE,GAASxE,CAAK;AAEf,gBAAA,IAAIE,EAAW,oBAAoB;AAAA;AAAA,MAE7C;AAAA,MACA,KAAK,CAACyC,MAAa;AACjB,QAAKA,IAGSZ,EAAA,iBAAiB9B,EAAA,MAAM0C,CAAQ,IAF/BZ,EAAA,iBAAiB9B,EAAI,MAAE,MAAS;AAAA,MAIhD;AAAA,IAAA,CACD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ICrDcwE,KAAAC,GAmBbC,IAAM;AAAA,EAAA,aACNC;AAAAA,EAAA,eACAC;AAAAA,EAAA,UACAC;AAAAA,EAAA,cACAC;AAAAA,EAAA,aACAC;AAAAA,EAAA,YACAC;AAAAA,EAAA,eACAC;AAAAA,EAAA,UACAC;AAAAA,EAAA,QACAC;AAAAA,EAAA,WACAC;AAAAA,EAAA,WACAC;AAAAA,EAAA,aACAC;AAAAA,EAAA,SACAC;AAAAA,EAAA,UACAC;AAAAA,EAAA,aACAC;AACF,CAAC;"}
|
@@ -41,7 +41,10 @@ declare function __VLS_template(): {
|
|
41
41
|
onCurrentRowChange?: ((...args: any[]) => any) | undefined;
|
42
42
|
"onUpdate:pagination"?: ((...args: any[]) => any) | undefined;
|
43
43
|
onRowClick?: ((...args: any[]) => any) | undefined;
|
44
|
-
|
44
|
+
onRowDblclick?: ((...args: any[]) => any) | undefined;
|
45
|
+
onCellClick?: ((...args: any[]) => any) | undefined;
|
46
|
+
onCellDblclick?: ((...args: any[]) => any) | undefined;
|
47
|
+
}>, () => import("vue/jsx-runtime").JSX.Element, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, ("selectionChange" | "currentRowChange" | "update:pagination" | "rowClick" | "rowDblclick" | "cellClick" | "cellDblclick")[], import('vue').VNodeProps & import('vue').AllowedComponentProps & import('vue').ComponentCustomProps & Readonly<import('vue').ExtractPropTypes<{
|
45
48
|
data: {
|
46
49
|
type: import('vue').PropType<any[]>;
|
47
50
|
default: any[];
|
@@ -79,6 +82,9 @@ declare function __VLS_template(): {
|
|
79
82
|
onCurrentRowChange?: ((...args: any[]) => any) | undefined;
|
80
83
|
"onUpdate:pagination"?: ((...args: any[]) => any) | undefined;
|
81
84
|
onRowClick?: ((...args: any[]) => any) | undefined;
|
85
|
+
onRowDblclick?: ((...args: any[]) => any) | undefined;
|
86
|
+
onCellClick?: ((...args: any[]) => any) | undefined;
|
87
|
+
onCellDblclick?: ((...args: any[]) => any) | undefined;
|
82
88
|
}>, {
|
83
89
|
data: any[];
|
84
90
|
size: "" | "small" | "default" | "large";
|
@@ -135,6 +141,9 @@ declare function __VLS_template(): {
|
|
135
141
|
onCurrentRowChange?: ((...args: any[]) => any) | undefined;
|
136
142
|
"onUpdate:pagination"?: ((...args: any[]) => any) | undefined;
|
137
143
|
onRowClick?: ((...args: any[]) => any) | undefined;
|
144
|
+
onRowDblclick?: ((...args: any[]) => any) | undefined;
|
145
|
+
onCellClick?: ((...args: any[]) => any) | undefined;
|
146
|
+
onCellDblclick?: ((...args: any[]) => any) | undefined;
|
138
147
|
}>, () => import("vue/jsx-runtime").JSX.Element, {}, {}, {}, {
|
139
148
|
data: any[];
|
140
149
|
size: "" | "small" | "default" | "large";
|
@@ -208,7 +217,10 @@ declare const __VLS_component: import('vue').DefineComponent<{
|
|
208
217
|
onCurrentRowChange?: ((...args: any[]) => any) | undefined;
|
209
218
|
"onUpdate:pagination"?: ((...args: any[]) => any) | undefined;
|
210
219
|
onRowClick?: ((...args: any[]) => any) | undefined;
|
211
|
-
|
220
|
+
onRowDblclick?: ((...args: any[]) => any) | undefined;
|
221
|
+
onCellClick?: ((...args: any[]) => any) | undefined;
|
222
|
+
onCellDblclick?: ((...args: any[]) => any) | undefined;
|
223
|
+
}>, () => import("vue/jsx-runtime").JSX.Element, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, ("selectionChange" | "currentRowChange" | "update:pagination" | "rowClick" | "rowDblclick" | "cellClick" | "cellDblclick")[], import('vue').VNodeProps & import('vue').AllowedComponentProps & import('vue').ComponentCustomProps & Readonly<import('vue').ExtractPropTypes<{
|
212
224
|
data: {
|
213
225
|
type: import('vue').PropType<any[]>;
|
214
226
|
default: any[];
|
@@ -246,6 +258,9 @@ declare const __VLS_component: import('vue').DefineComponent<{
|
|
246
258
|
onCurrentRowChange?: ((...args: any[]) => any) | undefined;
|
247
259
|
"onUpdate:pagination"?: ((...args: any[]) => any) | undefined;
|
248
260
|
onRowClick?: ((...args: any[]) => any) | undefined;
|
261
|
+
onRowDblclick?: ((...args: any[]) => any) | undefined;
|
262
|
+
onCellClick?: ((...args: any[]) => any) | undefined;
|
263
|
+
onCellDblclick?: ((...args: any[]) => any) | undefined;
|
249
264
|
}>, {
|
250
265
|
data: any[];
|
251
266
|
size: "" | "small" | "default" | "large";
|
@@ -302,6 +317,9 @@ declare const __VLS_component: import('vue').DefineComponent<{
|
|
302
317
|
onCurrentRowChange?: ((...args: any[]) => any) | undefined;
|
303
318
|
"onUpdate:pagination"?: ((...args: any[]) => any) | undefined;
|
304
319
|
onRowClick?: ((...args: any[]) => any) | undefined;
|
320
|
+
onRowDblclick?: ((...args: any[]) => any) | undefined;
|
321
|
+
onCellClick?: ((...args: any[]) => any) | undefined;
|
322
|
+
onCellDblclick?: ((...args: any[]) => any) | undefined;
|
305
323
|
}>, () => import("vue/jsx-runtime").JSX.Element, {}, {}, {}, {
|
306
324
|
data: any[];
|
307
325
|
size: "" | "small" | "default" | "large";
|
@@ -28,7 +28,10 @@ declare function __VLS_template(): {
|
|
28
28
|
onSelectionChange?: ((...args: any[]) => any) | undefined;
|
29
29
|
onCurrentRowChange?: ((...args: any[]) => any) | undefined;
|
30
30
|
onRowClick?: ((...args: any[]) => any) | undefined;
|
31
|
-
|
31
|
+
onRowDblclick?: ((...args: any[]) => any) | undefined;
|
32
|
+
onCellClick?: ((...args: any[]) => any) | undefined;
|
33
|
+
onCellDblclick?: ((...args: any[]) => any) | undefined;
|
34
|
+
}>, () => import("vue/jsx-runtime").JSX.Element, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, ("selectionChange" | "currentRowChange" | "rowClick" | "rowDblclick" | "cellClick" | "cellDblclick")[], import('vue').VNodeProps & import('vue').AllowedComponentProps & import('vue').ComponentCustomProps & Readonly<import('vue').ExtractPropTypes<{
|
32
35
|
data: {
|
33
36
|
type: import('vue').PropType<any[]>;
|
34
37
|
default: any[];
|
@@ -53,6 +56,9 @@ declare function __VLS_template(): {
|
|
53
56
|
onSelectionChange?: ((...args: any[]) => any) | undefined;
|
54
57
|
onCurrentRowChange?: ((...args: any[]) => any) | undefined;
|
55
58
|
onRowClick?: ((...args: any[]) => any) | undefined;
|
59
|
+
onRowDblclick?: ((...args: any[]) => any) | undefined;
|
60
|
+
onCellClick?: ((...args: any[]) => any) | undefined;
|
61
|
+
onCellDblclick?: ((...args: any[]) => any) | undefined;
|
56
62
|
}>, {
|
57
63
|
data: any[];
|
58
64
|
size: "" | "small" | "default" | "large";
|
@@ -91,6 +97,9 @@ declare function __VLS_template(): {
|
|
91
97
|
onSelectionChange?: ((...args: any[]) => any) | undefined;
|
92
98
|
onCurrentRowChange?: ((...args: any[]) => any) | undefined;
|
93
99
|
onRowClick?: ((...args: any[]) => any) | undefined;
|
100
|
+
onRowDblclick?: ((...args: any[]) => any) | undefined;
|
101
|
+
onCellClick?: ((...args: any[]) => any) | undefined;
|
102
|
+
onCellDblclick?: ((...args: any[]) => any) | undefined;
|
94
103
|
}>, () => import("vue/jsx-runtime").JSX.Element, {}, {}, {}, {
|
95
104
|
data: any[];
|
96
105
|
size: "" | "small" | "default" | "large";
|
@@ -132,7 +141,10 @@ declare const __VLS_component: import('vue').DefineComponent<{
|
|
132
141
|
onSelectionChange?: ((...args: any[]) => any) | undefined;
|
133
142
|
onCurrentRowChange?: ((...args: any[]) => any) | undefined;
|
134
143
|
onRowClick?: ((...args: any[]) => any) | undefined;
|
135
|
-
|
144
|
+
onRowDblclick?: ((...args: any[]) => any) | undefined;
|
145
|
+
onCellClick?: ((...args: any[]) => any) | undefined;
|
146
|
+
onCellDblclick?: ((...args: any[]) => any) | undefined;
|
147
|
+
}>, () => import("vue/jsx-runtime").JSX.Element, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, ("selectionChange" | "currentRowChange" | "rowClick" | "rowDblclick" | "cellClick" | "cellDblclick")[], import('vue').VNodeProps & import('vue').AllowedComponentProps & import('vue').ComponentCustomProps & Readonly<import('vue').ExtractPropTypes<{
|
136
148
|
data: {
|
137
149
|
type: import('vue').PropType<any[]>;
|
138
150
|
default: any[];
|
@@ -157,6 +169,9 @@ declare const __VLS_component: import('vue').DefineComponent<{
|
|
157
169
|
onSelectionChange?: ((...args: any[]) => any) | undefined;
|
158
170
|
onCurrentRowChange?: ((...args: any[]) => any) | undefined;
|
159
171
|
onRowClick?: ((...args: any[]) => any) | undefined;
|
172
|
+
onRowDblclick?: ((...args: any[]) => any) | undefined;
|
173
|
+
onCellClick?: ((...args: any[]) => any) | undefined;
|
174
|
+
onCellDblclick?: ((...args: any[]) => any) | undefined;
|
160
175
|
}>, {
|
161
176
|
data: any[];
|
162
177
|
size: "" | "small" | "default" | "large";
|
@@ -195,6 +210,9 @@ declare const __VLS_component: import('vue').DefineComponent<{
|
|
195
210
|
onSelectionChange?: ((...args: any[]) => any) | undefined;
|
196
211
|
onCurrentRowChange?: ((...args: any[]) => any) | undefined;
|
197
212
|
onRowClick?: ((...args: any[]) => any) | undefined;
|
213
|
+
onRowDblclick?: ((...args: any[]) => any) | undefined;
|
214
|
+
onCellClick?: ((...args: any[]) => any) | undefined;
|
215
|
+
onCellDblclick?: ((...args: any[]) => any) | undefined;
|
198
216
|
}>, () => import("vue/jsx-runtime").JSX.Element, {}, {}, {}, {
|
199
217
|
data: any[];
|
200
218
|
size: "" | "small" | "default" | "large";
|
@@ -30,7 +30,10 @@ declare const _default: import('../_util').SFCWithInstall<{}> & {
|
|
30
30
|
onSelectionChange?: ((...args: any[]) => any) | undefined;
|
31
31
|
onCurrentRowChange?: ((...args: any[]) => any) | undefined;
|
32
32
|
onRowClick?: ((...args: any[]) => any) | undefined;
|
33
|
-
|
33
|
+
onRowDblclick?: ((...args: any[]) => any) | undefined;
|
34
|
+
onCellClick?: ((...args: any[]) => any) | undefined;
|
35
|
+
onCellDblclick?: ((...args: any[]) => any) | undefined;
|
36
|
+
}>, () => import("vue/jsx-runtime").JSX.Element, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, ("selectionChange" | "currentRowChange" | "rowClick" | "rowDblclick" | "cellClick" | "cellDblclick")[], import('vue').VNodeProps & import('vue').AllowedComponentProps & import('vue').ComponentCustomProps & Readonly<import('vue').ExtractPropTypes<{
|
34
37
|
data: {
|
35
38
|
type: import('vue').PropType<any[]>;
|
36
39
|
default: any[];
|
@@ -55,6 +58,9 @@ declare const _default: import('../_util').SFCWithInstall<{}> & {
|
|
55
58
|
onSelectionChange?: ((...args: any[]) => any) | undefined;
|
56
59
|
onCurrentRowChange?: ((...args: any[]) => any) | undefined;
|
57
60
|
onRowClick?: ((...args: any[]) => any) | undefined;
|
61
|
+
onRowDblclick?: ((...args: any[]) => any) | undefined;
|
62
|
+
onCellClick?: ((...args: any[]) => any) | undefined;
|
63
|
+
onCellDblclick?: ((...args: any[]) => any) | undefined;
|
58
64
|
}>, {
|
59
65
|
data: any[];
|
60
66
|
size: "" | "small" | "default" | "large";
|
@@ -93,6 +99,9 @@ declare const _default: import('../_util').SFCWithInstall<{}> & {
|
|
93
99
|
onSelectionChange?: ((...args: any[]) => any) | undefined;
|
94
100
|
onCurrentRowChange?: ((...args: any[]) => any) | undefined;
|
95
101
|
onRowClick?: ((...args: any[]) => any) | undefined;
|
102
|
+
onRowDblclick?: ((...args: any[]) => any) | undefined;
|
103
|
+
onCellClick?: ((...args: any[]) => any) | undefined;
|
104
|
+
onCellDblclick?: ((...args: any[]) => any) | undefined;
|
96
105
|
}>, () => import("vue/jsx-runtime").JSX.Element, {}, {}, {}, {
|
97
106
|
data: any[];
|
98
107
|
size: "" | "small" | "default" | "large";
|
@@ -180,7 +189,10 @@ declare const _default: import('../_util').SFCWithInstall<{}> & {
|
|
180
189
|
onCurrentRowChange?: ((...args: any[]) => any) | undefined;
|
181
190
|
"onUpdate:pagination"?: ((...args: any[]) => any) | undefined;
|
182
191
|
onRowClick?: ((...args: any[]) => any) | undefined;
|
183
|
-
|
192
|
+
onRowDblclick?: ((...args: any[]) => any) | undefined;
|
193
|
+
onCellClick?: ((...args: any[]) => any) | undefined;
|
194
|
+
onCellDblclick?: ((...args: any[]) => any) | undefined;
|
195
|
+
}>, () => import("vue/jsx-runtime").JSX.Element, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, ("selectionChange" | "currentRowChange" | "update:pagination" | "rowClick" | "rowDblclick" | "cellClick" | "cellDblclick")[], import('vue').VNodeProps & import('vue').AllowedComponentProps & import('vue').ComponentCustomProps & Readonly<import('vue').ExtractPropTypes<{
|
184
196
|
data: {
|
185
197
|
type: import('vue').PropType<any[]>;
|
186
198
|
default: any[];
|
@@ -218,6 +230,9 @@ declare const _default: import('../_util').SFCWithInstall<{}> & {
|
|
218
230
|
onCurrentRowChange?: ((...args: any[]) => any) | undefined;
|
219
231
|
"onUpdate:pagination"?: ((...args: any[]) => any) | undefined;
|
220
232
|
onRowClick?: ((...args: any[]) => any) | undefined;
|
233
|
+
onRowDblclick?: ((...args: any[]) => any) | undefined;
|
234
|
+
onCellClick?: ((...args: any[]) => any) | undefined;
|
235
|
+
onCellDblclick?: ((...args: any[]) => any) | undefined;
|
221
236
|
}>, {
|
222
237
|
data: any[];
|
223
238
|
size: "" | "small" | "default" | "large";
|
@@ -274,6 +289,9 @@ declare const _default: import('../_util').SFCWithInstall<{}> & {
|
|
274
289
|
onCurrentRowChange?: ((...args: any[]) => any) | undefined;
|
275
290
|
"onUpdate:pagination"?: ((...args: any[]) => any) | undefined;
|
276
291
|
onRowClick?: ((...args: any[]) => any) | undefined;
|
292
|
+
onRowDblclick?: ((...args: any[]) => any) | undefined;
|
293
|
+
onCellClick?: ((...args: any[]) => any) | undefined;
|
294
|
+
onCellDblclick?: ((...args: any[]) => any) | undefined;
|
277
295
|
}>, () => import("vue/jsx-runtime").JSX.Element, {}, {}, {}, {
|
278
296
|
data: any[];
|
279
297
|
size: "" | "small" | "default" | "large";
|
@@ -67,7 +67,7 @@ declare const _default: import('vue').DefineComponent<ExtractPropTypes<{
|
|
67
67
|
type: PropType<"" | "small" | "default" | "large">;
|
68
68
|
default: "" | "small" | "default" | "large";
|
69
69
|
};
|
70
|
-
}>, () => import("vue/jsx-runtime").JSX.Element, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, ("selectionChange" | "currentRowChange" | "update:pagination" | "rowClick")[], "selectionChange" | "currentRowChange" | "update:pagination" | "rowClick", import('vue').PublicProps, Readonly<ExtractPropTypes<{
|
70
|
+
}>, () => import("vue/jsx-runtime").JSX.Element, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, ("selectionChange" | "currentRowChange" | "update:pagination" | "rowClick" | "rowDblclick" | "cellClick" | "cellDblclick")[], "selectionChange" | "currentRowChange" | "update:pagination" | "rowClick" | "rowDblclick" | "cellClick" | "cellDblclick", import('vue').PublicProps, Readonly<ExtractPropTypes<{
|
71
71
|
data: {
|
72
72
|
type: PropType<any[]>;
|
73
73
|
default: any[];
|
@@ -105,6 +105,9 @@ declare const _default: import('vue').DefineComponent<ExtractPropTypes<{
|
|
105
105
|
onCurrentRowChange?: ((...args: any[]) => any) | undefined;
|
106
106
|
"onUpdate:pagination"?: ((...args: any[]) => any) | undefined;
|
107
107
|
onRowClick?: ((...args: any[]) => any) | undefined;
|
108
|
+
onRowDblclick?: ((...args: any[]) => any) | undefined;
|
109
|
+
onCellClick?: ((...args: any[]) => any) | undefined;
|
110
|
+
onCellDblclick?: ((...args: any[]) => any) | undefined;
|
108
111
|
}>, {
|
109
112
|
data: any[];
|
110
113
|
size: "" | "small" | "default" | "large";
|
@@ -42,7 +42,7 @@ declare const _default: import('../_util').SFCWithInstall<import('vue').DefineCo
|
|
42
42
|
type: import('vue').PropType<"" | "small" | "default" | "large">;
|
43
43
|
default: "" | "small" | "default" | "large";
|
44
44
|
};
|
45
|
-
}>, () => import("vue/jsx-runtime").JSX.Element, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, ("selectionChange" | "currentRowChange" | "update:pagination" | "rowClick")[], "selectionChange" | "currentRowChange" | "update:pagination" | "rowClick", import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<{
|
45
|
+
}>, () => import("vue/jsx-runtime").JSX.Element, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, ("selectionChange" | "currentRowChange" | "update:pagination" | "rowClick" | "rowDblclick" | "cellClick" | "cellDblclick")[], "selectionChange" | "currentRowChange" | "update:pagination" | "rowClick" | "rowDblclick" | "cellClick" | "cellDblclick", import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<{
|
46
46
|
data: {
|
47
47
|
type: import('vue').PropType<any[]>;
|
48
48
|
default: any[];
|
@@ -80,6 +80,9 @@ declare const _default: import('../_util').SFCWithInstall<import('vue').DefineCo
|
|
80
80
|
onCurrentRowChange?: ((...args: any[]) => any) | undefined;
|
81
81
|
"onUpdate:pagination"?: ((...args: any[]) => any) | undefined;
|
82
82
|
onRowClick?: ((...args: any[]) => any) | undefined;
|
83
|
+
onRowDblclick?: ((...args: any[]) => any) | undefined;
|
84
|
+
onCellClick?: ((...args: any[]) => any) | undefined;
|
85
|
+
onCellDblclick?: ((...args: any[]) => any) | undefined;
|
83
86
|
}>, {
|
84
87
|
data: any[];
|
85
88
|
size: "" | "small" | "default" | "large";
|