orion-design 0.1.21 → 0.1.23
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/index.js +8 -12
- package/dist/components/Form/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
package/README.md
CHANGED
@@ -1,5 +1,5 @@
|
|
1
|
-
# Vue 3 + TypeScript + Vite
|
2
|
-
|
3
|
-
This template should help get you started developing with Vue 3 and TypeScript in Vite. The template uses Vue 3 `<script setup>` SFCs, check out the [script setup docs](https://v3.vuejs.org/api/sfc-script-setup.html#sfc-script-setup) to learn more.
|
4
|
-
|
5
|
-
Learn more about the recommended Project Setup and IDE Support in the [Vue Docs TypeScript Guide](https://vuejs.org/guide/typescript/overview.html#project-setup).
|
1
|
+
# Vue 3 + TypeScript + Vite
|
2
|
+
|
3
|
+
This template should help get you started developing with Vue 3 and TypeScript in Vite. The template uses Vue 3 `<script setup>` SFCs, check out the [script setup docs](https://v3.vuejs.org/api/sfc-script-setup.html#sfc-script-setup) to learn more.
|
4
|
+
|
5
|
+
Learn more about the recommended Project Setup and IDE Support in the [Vue Docs TypeScript Guide](https://vuejs.org/guide/typescript/overview.html#project-setup).
|
@@ -495,8 +495,8 @@ const Ce = /* @__PURE__ */ c({
|
|
495
495
|
placeholder: {},
|
496
496
|
disabled: { type: Boolean },
|
497
497
|
readonly: { type: Boolean },
|
498
|
-
editable: { type: Boolean },
|
499
|
-
clearable: { type: Boolean },
|
498
|
+
editable: { type: Boolean, default: !0 },
|
499
|
+
clearable: { type: Boolean, default: !0 },
|
500
500
|
format: { default: "YYYY-MM-DD" },
|
501
501
|
sourceFormat: {}
|
502
502
|
},
|
@@ -792,17 +792,13 @@ const Ce = /* @__PURE__ */ c({
|
|
792
792
|
placeholder: {},
|
793
793
|
disabled: { type: Boolean },
|
794
794
|
readonly: { type: Boolean },
|
795
|
-
min: {
|
796
|
-
|
797
|
-
|
798
|
-
|
799
|
-
|
800
|
-
stepStrictly: { type: Boolean, default: !1 },
|
801
|
-
precision: { default: () => {
|
802
|
-
} },
|
795
|
+
min: {},
|
796
|
+
max: {},
|
797
|
+
step: {},
|
798
|
+
stepStrictly: { type: Boolean },
|
799
|
+
precision: {},
|
803
800
|
controls: { type: Boolean, default: !0 },
|
804
|
-
controlsPosition: {
|
805
|
-
} }
|
801
|
+
controlsPosition: {}
|
806
802
|
},
|
807
803
|
setup(t) {
|
808
804
|
const s = v(), i = V(), o = N(), l = F({
|
@@ -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/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,\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","<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 = undefined,\r\n max = undefined,\r\n step = 1,\r\n stepStrictly = false,\r\n precision = undefined,\r\n controls = true,\r\n controlsPosition = undefined,\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":";;;;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AII;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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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;"}
|
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","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arrays.ts"],"sourcesContent":["export const unique = <T>(arr: T[]) => [...new Set(arr)]\n\ntype Many<T> = T | ReadonlyArray<T>\n// TODO: rename to `ensureArray`\n/** like `_.castArray`, except falsy value returns empty array. */\nexport const castArray = <T>(arr: Many<T>): T[] => {\n if (!arr && (arr as any) !== 0) return []\n return Array.isArray(arr) ? arr : [arr]\n}\n\n// TODO: remove import alias\n// avoid naming conflicts\nexport { castArray as ensureArray } from 'lodash-unified'\n"],"names":["unique","arr","castArray"],"mappings":";AAAa,MAAAA,IAAS,CAAIC,MAAa,CAAC,GAAG,IAAI,IAAIA,CAAG,CAAC,GAK1CC,IAAY,CAAID,MACvB,CAACA,KAAQA,MAAgB,IAAU,CAAA,IAChC,MAAM,QAAQA,CAAG,IAAIA,IAAM,CAACA,CAAG;"}
|
1
|
+
{"version":3,"file":"arrays.js","sources":["../../../src/components/_util/arrays.ts"],"sourcesContent":["export const unique = <T>(arr: T[]) => [...new Set(arr)]\r\n\r\ntype Many<T> = T | ReadonlyArray<T>\r\n// TODO: rename to `ensureArray`\r\n/** like `_.castArray`, except falsy value returns empty array. */\r\nexport const castArray = <T>(arr: Many<T>): T[] => {\r\n if (!arr && (arr as any) !== 0) return []\r\n return Array.isArray(arr) ? arr : [arr]\r\n}\r\n\r\n// TODO: remove import alias\r\n// avoid naming conflicts\r\nexport { castArray as ensureArray } from 'lodash-unified'\r\n"],"names":["unique","arr","castArray"],"mappings":";AAAa,MAAAA,IAAS,CAAIC,MAAa,CAAC,GAAG,IAAI,IAAIA,CAAG,CAAC,GAK1CC,IAAY,CAAID,MACvB,CAACA,KAAQA,MAAgB,IAAU,CAAA,IAChC,MAAM,QAAQA,CAAG,IAAIA,IAAM,CAACA,CAAG;"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"browser.js","sources":["../../../src/components/_util/browser.ts"],"sourcesContent":["import { isClient, isIOS } from '@vueuse/core'\n\nexport const isFirefox = (): boolean =>\n isClient && /firefox/i.test(window.navigator.userAgent)\n\nexport { isClient, isIOS }\n"],"names":["isFirefox","isClient"],"mappings":";;AAEO,MAAMA,IAAY,MACvBC,KAAY,WAAW,KAAK,OAAO,UAAU,SAAS;"}
|
1
|
+
{"version":3,"file":"browser.js","sources":["../../../src/components/_util/browser.ts"],"sourcesContent":["import { isClient, isIOS } from '@vueuse/core'\r\n\r\nexport const isFirefox = (): boolean =>\r\n isClient && /firefox/i.test(window.navigator.userAgent)\r\n\r\nexport { isClient, isIOS }\r\n"],"names":["isFirefox","isClient"],"mappings":";;AAEO,MAAMA,IAAY,MACvBC,KAAY,WAAW,KAAK,OAAO,UAAU,SAAS;"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"aria.js","sources":["../../../../src/components/_util/dom/aria.ts"],"sourcesContent":["const FOCUSABLE_ELEMENT_SELECTORS = `a[href],button:not([disabled]),button:not([hidden]),:not([tabindex=\"-1\"]),input:not([disabled]),input:not([type=\"hidden\"]),select:not([disabled]),textarea:not([disabled])`\n\n/**\n * Determine if the testing element is visible on screen no matter if its on the viewport or not\n */\nexport const isVisible = (element: HTMLElement) => {\n if (process.env.NODE_ENV === 'test') return true\n const computed = getComputedStyle(element)\n // element.offsetParent won't work on fix positioned\n // WARNING: potential issue here, going to need some expert advices on this issue\n return computed.position === 'fixed' ? false : element.offsetParent !== null\n}\n\nexport const obtainAllFocusableElements = (\n element: HTMLElement\n): HTMLElement[] => {\n return Array.from(\n element.querySelectorAll<HTMLElement>(FOCUSABLE_ELEMENT_SELECTORS)\n ).filter((item: HTMLElement) => isFocusable(item) && isVisible(item))\n}\n\n/**\n * @desc Determine if target element is focusable\n * @param element {HTMLElement}\n * @returns {Boolean} true if it is focusable\n */\nexport const isFocusable = (element: HTMLElement): boolean => {\n if (\n element.tabIndex > 0 ||\n (element.tabIndex === 0 && element.getAttribute('tabIndex') !== null)\n ) {\n return true\n }\n // HTMLButtonElement has disabled\n if ((element as HTMLButtonElement).disabled) {\n return false\n }\n\n switch (element.nodeName) {\n case 'A': {\n // casting current element to Specific HTMLElement in order to be more type precise\n return (\n !!(element as HTMLAnchorElement).href &&\n (element as HTMLAnchorElement).rel !== 'ignore'\n )\n }\n case 'INPUT': {\n return !(\n (element as HTMLInputElement).type === 'hidden' ||\n (element as HTMLInputElement).type === 'file'\n )\n }\n case 'BUTTON':\n case 'SELECT':\n case 'TEXTAREA': {\n return true\n }\n default: {\n return false\n }\n }\n}\n\n/**\n * @desc Set Attempt to set focus on the current node.\n * @param element\n * The node to attempt to focus on.\n * @returns\n * true if element is focused.\n */\nexport const attemptFocus = (element: HTMLElement): boolean => {\n if (!isFocusable(element)) {\n return false\n }\n // Remove the old try catch block since there will be no error to be thrown\n element.focus?.()\n return document.activeElement === element\n}\n\n/**\n * Trigger an event\n * mouseenter, mouseleave, mouseover, keyup, change, click, etc.\n * @param {HTMLElement} elm\n * @param {String} name\n * @param {*} opts\n */\nexport const triggerEvent = function (\n elm: HTMLElement,\n name: string,\n ...opts: Array<boolean>\n): HTMLElement {\n let eventName: string\n\n if (name.includes('mouse') || name.includes('click')) {\n eventName = 'MouseEvents'\n } else if (name.includes('key')) {\n eventName = 'KeyboardEvent'\n } else {\n eventName = 'HTMLEvents'\n }\n const evt = document.createEvent(eventName)\n\n evt.initEvent(name, ...opts)\n elm.dispatchEvent(evt)\n return elm\n}\n\nexport const isLeaf = (el: HTMLElement) => !el.getAttribute('aria-owns')\n\nexport const getSibling = (\n el: HTMLElement,\n distance: number,\n elClass: string\n) => {\n const { parentNode } = el\n if (!parentNode) return null\n const siblings = parentNode.querySelectorAll(elClass)\n const index = Array.prototype.indexOf.call(siblings, el)\n return siblings[index + distance] || null\n}\n\nexport const focusNode = (el: HTMLElement) => {\n if (!el) return\n el.focus()\n !isLeaf(el) && el.click()\n}\n"],"names":["FOCUSABLE_ELEMENT_SELECTORS","isVisible","element","obtainAllFocusableElements","item","isFocusable","attemptFocus","_a","triggerEvent","elm","name","opts","eventName","evt","isLeaf","el","getSibling","distance","elClass","parentNode","siblings","index","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a,CACxBD,GACAE,GACAC,MACG;AACG,QAAA,EAAE,YAAAC,EAAe,IAAAJ;AACnB,MAAA,CAACI,EAAmB,QAAA;AAClB,QAAAC,IAAWD,EAAW,iBAAiBD,CAAO,GAC9CG,IAAQ,MAAM,UAAU,QAAQ,KAAKD,GAAUL,CAAE;AAChD,SAAAK,EAASC,IAAQJ,CAAQ,KAAK;AACvC,GAEaK,IAAY,CAACP,MAAoB;AAC5C,EAAKA,MACLA,EAAG,MAAM,GACT,CAACD,EAAOC,CAAE,KAAKA,EAAG,MAAM;AAC1B;"}
|
1
|
+
{"version":3,"file":"aria.js","sources":["../../../../src/components/_util/dom/aria.ts"],"sourcesContent":["const FOCUSABLE_ELEMENT_SELECTORS = `a[href],button:not([disabled]),button:not([hidden]),:not([tabindex=\"-1\"]),input:not([disabled]),input:not([type=\"hidden\"]),select:not([disabled]),textarea:not([disabled])`\r\n\r\n/**\r\n * Determine if the testing element is visible on screen no matter if its on the viewport or not\r\n */\r\nexport const isVisible = (element: HTMLElement) => {\r\n if (process.env.NODE_ENV === 'test') return true\r\n const computed = getComputedStyle(element)\r\n // element.offsetParent won't work on fix positioned\r\n // WARNING: potential issue here, going to need some expert advices on this issue\r\n return computed.position === 'fixed' ? false : element.offsetParent !== null\r\n}\r\n\r\nexport const obtainAllFocusableElements = (\r\n element: HTMLElement\r\n): HTMLElement[] => {\r\n return Array.from(\r\n element.querySelectorAll<HTMLElement>(FOCUSABLE_ELEMENT_SELECTORS)\r\n ).filter((item: HTMLElement) => isFocusable(item) && isVisible(item))\r\n}\r\n\r\n/**\r\n * @desc Determine if target element is focusable\r\n * @param element {HTMLElement}\r\n * @returns {Boolean} true if it is focusable\r\n */\r\nexport const isFocusable = (element: HTMLElement): boolean => {\r\n if (\r\n element.tabIndex > 0 ||\r\n (element.tabIndex === 0 && element.getAttribute('tabIndex') !== null)\r\n ) {\r\n return true\r\n }\r\n // HTMLButtonElement has disabled\r\n if ((element as HTMLButtonElement).disabled) {\r\n return false\r\n }\r\n\r\n switch (element.nodeName) {\r\n case 'A': {\r\n // casting current element to Specific HTMLElement in order to be more type precise\r\n return (\r\n !!(element as HTMLAnchorElement).href &&\r\n (element as HTMLAnchorElement).rel !== 'ignore'\r\n )\r\n }\r\n case 'INPUT': {\r\n return !(\r\n (element as HTMLInputElement).type === 'hidden' ||\r\n (element as HTMLInputElement).type === 'file'\r\n )\r\n }\r\n case 'BUTTON':\r\n case 'SELECT':\r\n case 'TEXTAREA': {\r\n return true\r\n }\r\n default: {\r\n return false\r\n }\r\n }\r\n}\r\n\r\n/**\r\n * @desc Set Attempt to set focus on the current node.\r\n * @param element\r\n * The node to attempt to focus on.\r\n * @returns\r\n * true if element is focused.\r\n */\r\nexport const attemptFocus = (element: HTMLElement): boolean => {\r\n if (!isFocusable(element)) {\r\n return false\r\n }\r\n // Remove the old try catch block since there will be no error to be thrown\r\n element.focus?.()\r\n return document.activeElement === element\r\n}\r\n\r\n/**\r\n * Trigger an event\r\n * mouseenter, mouseleave, mouseover, keyup, change, click, etc.\r\n * @param {HTMLElement} elm\r\n * @param {String} name\r\n * @param {*} opts\r\n */\r\nexport const triggerEvent = function (\r\n elm: HTMLElement,\r\n name: string,\r\n ...opts: Array<boolean>\r\n): HTMLElement {\r\n let eventName: string\r\n\r\n if (name.includes('mouse') || name.includes('click')) {\r\n eventName = 'MouseEvents'\r\n } else if (name.includes('key')) {\r\n eventName = 'KeyboardEvent'\r\n } else {\r\n eventName = 'HTMLEvents'\r\n }\r\n const evt = document.createEvent(eventName)\r\n\r\n evt.initEvent(name, ...opts)\r\n elm.dispatchEvent(evt)\r\n return elm\r\n}\r\n\r\nexport const isLeaf = (el: HTMLElement) => !el.getAttribute('aria-owns')\r\n\r\nexport const getSibling = (\r\n el: HTMLElement,\r\n distance: number,\r\n elClass: string\r\n) => {\r\n const { parentNode } = el\r\n if (!parentNode) return null\r\n const siblings = parentNode.querySelectorAll(elClass)\r\n const index = Array.prototype.indexOf.call(siblings, el)\r\n return siblings[index + distance] || null\r\n}\r\n\r\nexport const focusNode = (el: HTMLElement) => {\r\n if (!el) return\r\n el.focus()\r\n !isLeaf(el) && el.click()\r\n}\r\n"],"names":["FOCUSABLE_ELEMENT_SELECTORS","isVisible","element","obtainAllFocusableElements","item","isFocusable","attemptFocus","_a","triggerEvent","elm","name","opts","eventName","evt","isLeaf","el","getSibling","distance","elClass","parentNode","siblings","index","focusNode"],"mappings":"AAAA,MAAMA,IAA8B,8KAKvBC,IAAY,CAACC,MACpB,QAAQ,IAAI,aAAa,SAAe,KAC3B,iBAAiBA,CAAO,EAGzB,aAAa,UAAU,KAAQA,EAAQ,iBAAiB,MAG7DC,IAA6B,CACxCD,MAEO,MAAM;AAAA,EACXA,EAAQ,iBAA8BF,CAA2B;AAAA,EACjE,OAAO,CAACI,MAAsBC,EAAYD,CAAI,KAAKH,EAAUG,CAAI,CAAC,GAQzDC,IAAc,CAACH,MAAkC;AAE1D,MAAAA,EAAQ,WAAW,KAClBA,EAAQ,aAAa,KAAKA,EAAQ,aAAa,UAAU,MAAM;AAEzD,WAAA;AAGT,MAAKA,EAA8B;AAC1B,WAAA;AAGT,UAAQA,EAAQ,UAAU;AAAA,IACxB,KAAK;AAEH,aACE,CAAC,CAAEA,EAA8B,QAChCA,EAA8B,QAAQ;AAAA,IAG3C,KAAK;AACH,aAAO,EACJA,EAA6B,SAAS,YACtCA,EAA6B,SAAS;AAAA,IAG3C,KAAK;AAAA,IACL,KAAK;AAAA,IACL,KAAK;AACI,aAAA;AAAA,IAET;AACS,aAAA;AAAA,EAEX;AACF,GASaI,IAAe,CAACJ,MAAkC;AAtE/D,MAAAK;AAuEM,SAACF,EAAYH,CAAO,MAIxBK,IAAAL,EAAQ,UAAR,QAAAK,EAAA,KAAAL,IACO,SAAS,kBAAkBA,KAJzB;AAKX,GASaM,IAAe,SAC1BC,GACAC,MACGC,GACU;AACT,MAAAC;AAEJ,EAAIF,EAAK,SAAS,OAAO,KAAKA,EAAK,SAAS,OAAO,IACrCE,IAAA,gBACHF,EAAK,SAAS,KAAK,IAChBE,IAAA,kBAEAA,IAAA;AAER,QAAAC,IAAM,SAAS,YAAYD,CAAS;AAEtC,SAAAC,EAAA,UAAUH,GAAM,GAAGC,CAAI,GAC3BF,EAAI,cAAcI,CAAG,GACdJ;AACT,GAEaK,IAAS,CAACC,MAAoB,CAACA,EAAG,aAAa,WAAW,GAE1DC,IAAa,CACxBD,GACAE,GACAC,MACG;AACG,QAAA,EAAE,YAAAC,EAAe,IAAAJ;AACnB,MAAA,CAACI,EAAmB,QAAA;AAClB,QAAAC,IAAWD,EAAW,iBAAiBD,CAAO,GAC9CG,IAAQ,MAAM,UAAU,QAAQ,KAAKD,GAAUL,CAAE;AAChD,SAAAK,EAASC,IAAQJ,CAAQ,KAAK;AACvC,GAEaK,IAAY,CAACP,MAAoB;AAC5C,EAAKA,MACLA,EAAG,MAAM,GACT,CAACD,EAAOC,CAAE,KAAKA,EAAG,MAAM;AAC1B;"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"element.js","sources":["../../../../src/components/_util/dom/element.ts"],"sourcesContent":["import { isString } from '../types'\nimport { isClient } from '../browser'\n\ntype GetElement = <T extends string | HTMLElement | Window | null | undefined>(\n target: T\n) => T extends string ? HTMLElement | null : T\n\nexport const getElement = ((\n target: string | HTMLElement | Window | null | undefined\n) => {\n if (!isClient || target === '') return null\n if (isString(target)) {\n try {\n return document.querySelector<HTMLElement>(target)\n } catch {\n return null\n }\n }\n return target\n}) as GetElement\n"],"names":["getElement","target","isClient","isString"],"mappings":";;;;AAOa,MAAAA,IAAc,CACzBC,MACG;AACH,MAAI,CAACC,KAAYD,MAAW,GAAW,QAAA;AACnC,MAAAE,EAASF,CAAM;AACb,QAAA;AACK,aAAA,SAAS,cAA2BA,CAAM;AAAA,IAAA,QAC3C;AACC,aAAA;AAAA,IACT;AAEK,SAAAA;AACT;"}
|
1
|
+
{"version":3,"file":"element.js","sources":["../../../../src/components/_util/dom/element.ts"],"sourcesContent":["import { isString } from '../types'\r\nimport { isClient } from '../browser'\r\n\r\ntype GetElement = <T extends string | HTMLElement | Window | null | undefined>(\r\n target: T\r\n) => T extends string ? HTMLElement | null : T\r\n\r\nexport const getElement = ((\r\n target: string | HTMLElement | Window | null | undefined\r\n) => {\r\n if (!isClient || target === '') return null\r\n if (isString(target)) {\r\n try {\r\n return document.querySelector<HTMLElement>(target)\r\n } catch {\r\n return null\r\n }\r\n }\r\n return target\r\n}) as GetElement\r\n"],"names":["getElement","target","isClient","isString"],"mappings":";;;;AAOa,MAAAA,IAAc,CACzBC,MACG;AACH,MAAI,CAACC,KAAYD,MAAW,GAAW,QAAA;AACnC,MAAAE,EAASF,CAAM;AACb,QAAA;AACK,aAAA,SAAS,cAA2BA,CAAM;AAAA,IAAA,QAC3C;AACC,aAAA;AAAA,IACT;AAEK,SAAAA;AACT;"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"event.js","sources":["../../../../src/components/_util/dom/event.ts"],"sourcesContent":["export const composeEventHandlers = <E>(\n theirsHandler?: (event: E) => boolean | void,\n oursHandler?: (event: E) => void,\n { checkForDefaultPrevented = true } = {}\n) => {\n const handleEvent = (event: E) => {\n const shouldPrevent = theirsHandler?.(event)\n\n if (checkForDefaultPrevented === false || !shouldPrevent) {\n return oursHandler?.(event)\n }\n }\n return handleEvent\n}\n\ntype WhenMouseHandler = (e: PointerEvent) => any\nexport const whenMouse = (handler: WhenMouseHandler): WhenMouseHandler => {\n return (e: PointerEvent) =>\n e.pointerType === 'mouse' ? handler(e) : undefined\n}\n"],"names":["composeEventHandlers","theirsHandler","oursHandler","checkForDefaultPrevented","event","shouldPrevent","whenMouse","handler","e"],"mappings":"AAAa,MAAAA,IAAuB,CAClCC,GACAC,GACA,EAAE,0BAAAC,IAA2B,GAAS,IAAA,OAElB,CAACC,MAAa;AAC1B,QAAAC,IAAgBJ,KAAA,gBAAAA,EAAgBG;AAElC,MAAAD,MAA6B,MAAS,CAACE;AACzC,WAAOH,KAAA,gBAAAA,EAAcE;AACvB,GAMSE,IAAY,CAACC,MACjB,CAACC,MACNA,EAAE,gBAAgB,UAAUD,EAAQC,CAAC,IAAI;"}
|
1
|
+
{"version":3,"file":"event.js","sources":["../../../../src/components/_util/dom/event.ts"],"sourcesContent":["export const composeEventHandlers = <E>(\r\n theirsHandler?: (event: E) => boolean | void,\r\n oursHandler?: (event: E) => void,\r\n { checkForDefaultPrevented = true } = {}\r\n) => {\r\n const handleEvent = (event: E) => {\r\n const shouldPrevent = theirsHandler?.(event)\r\n\r\n if (checkForDefaultPrevented === false || !shouldPrevent) {\r\n return oursHandler?.(event)\r\n }\r\n }\r\n return handleEvent\r\n}\r\n\r\ntype WhenMouseHandler = (e: PointerEvent) => any\r\nexport const whenMouse = (handler: WhenMouseHandler): WhenMouseHandler => {\r\n return (e: PointerEvent) =>\r\n e.pointerType === 'mouse' ? handler(e) : undefined\r\n}\r\n"],"names":["composeEventHandlers","theirsHandler","oursHandler","checkForDefaultPrevented","event","shouldPrevent","whenMouse","handler","e"],"mappings":"AAAa,MAAAA,IAAuB,CAClCC,GACAC,GACA,EAAE,0BAAAC,IAA2B,GAAS,IAAA,OAElB,CAACC,MAAa;AAC1B,QAAAC,IAAgBJ,KAAA,gBAAAA,EAAgBG;AAElC,MAAAD,MAA6B,MAAS,CAACE;AACzC,WAAOH,KAAA,gBAAAA,EAAcE;AACvB,GAMSE,IAAY,CAACC,MACjB,CAACC,MACNA,EAAE,gBAAgB,UAAUD,EAAQC,CAAC,IAAI;"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"position.js","sources":["../../../../src/components/_util/dom/position.ts"],"sourcesContent":["import { isClient } from '../browser'\n\nexport const isInContainer = (\n el?: Element,\n container?: Element | Window\n): boolean => {\n if (!isClient || !el || !container) return false\n\n const elRect = el.getBoundingClientRect()\n\n let containerRect: Pick<DOMRect, 'top' | 'bottom' | 'left' | 'right'>\n if (container instanceof Element) {\n containerRect = container.getBoundingClientRect()\n } else {\n containerRect = {\n top: 0,\n right: window.innerWidth,\n bottom: window.innerHeight,\n left: 0,\n }\n }\n return (\n elRect.top < containerRect.bottom &&\n elRect.bottom > containerRect.top &&\n elRect.right > containerRect.left &&\n elRect.left < containerRect.right\n )\n}\n\nexport const getOffsetTop = (el: HTMLElement) => {\n let offset = 0\n let parent = el\n\n while (parent) {\n offset += parent.offsetTop\n parent = parent.offsetParent as HTMLElement\n }\n\n return offset\n}\n\nexport const getOffsetTopDistance = (\n el: HTMLElement,\n containerEl: HTMLElement\n) => {\n return Math.abs(getOffsetTop(el) - getOffsetTop(containerEl))\n}\n\nexport const getClientXY = (event: MouseEvent | TouchEvent) => {\n let clientX: number\n let clientY: number\n if (event.type === 'touchend') {\n clientY = (event as TouchEvent).changedTouches[0].clientY\n clientX = (event as TouchEvent).changedTouches[0].clientX\n } else if (event.type.startsWith('touch')) {\n clientY = (event as TouchEvent).touches[0].clientY\n clientX = (event as TouchEvent).touches[0].clientX\n } else {\n clientY = (event as MouseEvent).clientY\n clientX = (event as MouseEvent).clientX\n }\n return {\n clientX,\n clientY,\n }\n}\n"],"names":["isInContainer","el","container","isClient","elRect","containerRect","getOffsetTop","offset","parent","getOffsetTopDistance","containerEl","getClientXY","event","clientX","clientY"],"mappings":";AAEa,MAAAA,IAAgB,CAC3BC,GACAC,MACY;AACZ,MAAI,CAACC,KAAY,CAACF,KAAM,CAACC,EAAkB,QAAA;AAErC,QAAAE,IAASH,EAAG;AAEd,MAAAI;AACJ,SAAIH,aAAqB,UACvBG,IAAgBH,EAAU,0BAEVG,IAAA;AAAA,IACd,KAAK;AAAA,IACL,OAAO,OAAO;AAAA,IACd,QAAQ,OAAO;AAAA,IACf,MAAM;AAAA,EAAA,GAIRD,EAAO,MAAMC,EAAc,UAC3BD,EAAO,SAASC,EAAc,OAC9BD,EAAO,QAAQC,EAAc,QAC7BD,EAAO,OAAOC,EAAc;AAEhC,GAEaC,IAAe,CAACL,MAAoB;AAC/C,MAAIM,IAAS,GACTC,IAASP;AAEb,SAAOO;AACL,IAAAD,KAAUC,EAAO,WACjBA,IAASA,EAAO;AAGX,SAAAD;AACT,GAEaE,IAAuB,CAClCR,GACAS,MAEO,KAAK,IAAIJ,EAAaL,CAAE,IAAIK,EAAaI,CAAW,CAAC,GAGjDC,IAAc,CAACC,MAAmC;AACzD,MAAAC,GACAC;AACA,SAAAF,EAAM,SAAS,cACNE,IAAAF,EAAqB,eAAe,CAAC,EAAE,SACvCC,IAAAD,EAAqB,eAAe,CAAC,EAAE,WACzCA,EAAM,KAAK,WAAW,OAAO,KAC3BE,IAAAF,EAAqB,QAAQ,CAAC,EAAE,SAChCC,IAAAD,EAAqB,QAAQ,CAAC,EAAE,YAE3CE,IAAWF,EAAqB,SAChCC,IAAWD,EAAqB,UAE3B;AAAA,IACL,SAAAC;AAAA,IACA,SAAAC;AAAA,EAAA;AAEJ;"}
|
1
|
+
{"version":3,"file":"position.js","sources":["../../../../src/components/_util/dom/position.ts"],"sourcesContent":["import { isClient } from '../browser'\r\n\r\nexport const isInContainer = (\r\n el?: Element,\r\n container?: Element | Window\r\n): boolean => {\r\n if (!isClient || !el || !container) return false\r\n\r\n const elRect = el.getBoundingClientRect()\r\n\r\n let containerRect: Pick<DOMRect, 'top' | 'bottom' | 'left' | 'right'>\r\n if (container instanceof Element) {\r\n containerRect = container.getBoundingClientRect()\r\n } else {\r\n containerRect = {\r\n top: 0,\r\n right: window.innerWidth,\r\n bottom: window.innerHeight,\r\n left: 0,\r\n }\r\n }\r\n return (\r\n elRect.top < containerRect.bottom &&\r\n elRect.bottom > containerRect.top &&\r\n elRect.right > containerRect.left &&\r\n elRect.left < containerRect.right\r\n )\r\n}\r\n\r\nexport const getOffsetTop = (el: HTMLElement) => {\r\n let offset = 0\r\n let parent = el\r\n\r\n while (parent) {\r\n offset += parent.offsetTop\r\n parent = parent.offsetParent as HTMLElement\r\n }\r\n\r\n return offset\r\n}\r\n\r\nexport const getOffsetTopDistance = (\r\n el: HTMLElement,\r\n containerEl: HTMLElement\r\n) => {\r\n return Math.abs(getOffsetTop(el) - getOffsetTop(containerEl))\r\n}\r\n\r\nexport const getClientXY = (event: MouseEvent | TouchEvent) => {\r\n let clientX: number\r\n let clientY: number\r\n if (event.type === 'touchend') {\r\n clientY = (event as TouchEvent).changedTouches[0].clientY\r\n clientX = (event as TouchEvent).changedTouches[0].clientX\r\n } else if (event.type.startsWith('touch')) {\r\n clientY = (event as TouchEvent).touches[0].clientY\r\n clientX = (event as TouchEvent).touches[0].clientX\r\n } else {\r\n clientY = (event as MouseEvent).clientY\r\n clientX = (event as MouseEvent).clientX\r\n }\r\n return {\r\n clientX,\r\n clientY,\r\n }\r\n}\r\n"],"names":["isInContainer","el","container","isClient","elRect","containerRect","getOffsetTop","offset","parent","getOffsetTopDistance","containerEl","getClientXY","event","clientX","clientY"],"mappings":";AAEa,MAAAA,IAAgB,CAC3BC,GACAC,MACY;AACZ,MAAI,CAACC,KAAY,CAACF,KAAM,CAACC,EAAkB,QAAA;AAErC,QAAAE,IAASH,EAAG;AAEd,MAAAI;AACJ,SAAIH,aAAqB,UACvBG,IAAgBH,EAAU,0BAEVG,IAAA;AAAA,IACd,KAAK;AAAA,IACL,OAAO,OAAO;AAAA,IACd,QAAQ,OAAO;AAAA,IACf,MAAM;AAAA,EAAA,GAIRD,EAAO,MAAMC,EAAc,UAC3BD,EAAO,SAASC,EAAc,OAC9BD,EAAO,QAAQC,EAAc,QAC7BD,EAAO,OAAOC,EAAc;AAEhC,GAEaC,IAAe,CAACL,MAAoB;AAC/C,MAAIM,IAAS,GACTC,IAASP;AAEb,SAAOO;AACL,IAAAD,KAAUC,EAAO,WACjBA,IAASA,EAAO;AAGX,SAAAD;AACT,GAEaE,IAAuB,CAClCR,GACAS,MAEO,KAAK,IAAIJ,EAAaL,CAAE,IAAIK,EAAaI,CAAW,CAAC,GAGjDC,IAAc,CAACC,MAAmC;AACzD,MAAAC,GACAC;AACA,SAAAF,EAAM,SAAS,cACNE,IAAAF,EAAqB,eAAe,CAAC,EAAE,SACvCC,IAAAD,EAAqB,eAAe,CAAC,EAAE,WACzCA,EAAM,KAAK,WAAW,OAAO,KAC3BE,IAAAF,EAAqB,QAAQ,CAAC,EAAE,SAChCC,IAAAD,EAAqB,QAAQ,CAAC,EAAE,YAE3CE,IAAWF,EAAqB,SAChCC,IAAWD,EAAqB,UAE3B;AAAA,IACL,SAAAC;AAAA,IACA,SAAAC;AAAA,EAAA;AAEJ;"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"scroll.js","sources":["../../../../src/components/_util/dom/scroll.ts"],"sourcesContent":["import { isClient } from '../browser'\nimport { easeInOutCubic } from '../easings'\nimport { isWindow } from '../types'\nimport { cAF, rAF } from '../raf'\nimport { getStyle } from './style'\n\nexport const isScroll = (el: HTMLElement, isVertical?: boolean): boolean => {\n if (!isClient) return false\n\n const key = (\n {\n undefined: 'overflow',\n true: 'overflow-y',\n false: 'overflow-x',\n } as const\n )[String(isVertical)]!\n const overflow = getStyle(el, key)\n return ['scroll', 'auto', 'overlay'].some((s) => overflow.includes(s))\n}\n\nexport const getScrollContainer = (\n el: HTMLElement,\n isVertical?: boolean\n): Window | HTMLElement | undefined => {\n if (!isClient) return\n\n let parent: HTMLElement = el\n while (parent) {\n if ([window, document, document.documentElement].includes(parent))\n return window\n\n if (isScroll(parent, isVertical)) return parent\n\n parent = parent.parentNode as HTMLElement\n }\n\n return parent\n}\n\nlet scrollBarWidth: number\nexport const getScrollBarWidth = (namespace: string): number => {\n if (!isClient) return 0\n if (scrollBarWidth !== undefined) return scrollBarWidth\n\n const outer = document.createElement('div')\n outer.className = `${namespace}-scrollbar__wrap`\n outer.style.visibility = 'hidden'\n outer.style.width = '100px'\n outer.style.position = 'absolute'\n outer.style.top = '-9999px'\n document.body.appendChild(outer)\n\n const widthNoScroll = outer.offsetWidth\n outer.style.overflow = 'scroll'\n\n const inner = document.createElement('div')\n inner.style.width = '100%'\n outer.appendChild(inner)\n\n const widthWithScroll = inner.offsetWidth\n outer.parentNode?.removeChild(outer)\n scrollBarWidth = widthNoScroll - widthWithScroll\n\n return scrollBarWidth\n}\n\n/**\n * Scroll with in the container element, positioning the **selected** element at the top\n * of the container\n */\nexport function scrollIntoView(\n container: HTMLElement,\n selected: HTMLElement\n): void {\n if (!isClient) return\n\n if (!selected) {\n container.scrollTop = 0\n return\n }\n\n const offsetParents: HTMLElement[] = []\n let pointer = selected.offsetParent\n while (\n pointer !== null &&\n container !== pointer &&\n container.contains(pointer)\n ) {\n offsetParents.push(pointer as HTMLElement)\n pointer = (pointer as HTMLElement).offsetParent\n }\n const top =\n selected.offsetTop +\n offsetParents.reduce((prev, curr) => prev + curr.offsetTop, 0)\n const bottom = top + selected.offsetHeight\n const viewRectTop = container.scrollTop\n const viewRectBottom = viewRectTop + container.clientHeight\n\n if (top < viewRectTop) {\n container.scrollTop = top\n } else if (bottom > viewRectBottom) {\n container.scrollTop = bottom - container.clientHeight\n }\n}\n\nexport function animateScrollTo(\n container: HTMLElement | Window,\n from: number,\n to: number,\n duration: number,\n callback?: unknown\n) {\n const startTime = Date.now()\n\n let handle: number | undefined\n const scroll = () => {\n const timestamp = Date.now()\n const time = timestamp - startTime\n const nextScrollTop = easeInOutCubic(\n time > duration ? duration : time,\n from,\n to,\n duration\n )\n\n if (isWindow(container)) {\n container.scrollTo(window.pageXOffset, nextScrollTop)\n } else {\n container.scrollTop = nextScrollTop\n }\n if (time < duration) {\n handle = rAF(scroll)\n } else if (typeof callback === 'function') {\n callback()\n }\n }\n\n scroll()\n\n return () => {\n handle && cAF(handle)\n }\n}\n\nexport const getScrollElement = (\n target: HTMLElement,\n container: HTMLElement | Window\n) => {\n if (isWindow(container)) {\n return target.ownerDocument.documentElement\n }\n return container\n}\n\nexport const getScrollTop = (container: HTMLElement | Window) => {\n if (isWindow(container)) {\n return window.scrollY\n }\n return container.scrollTop\n}\n"],"names":["isScroll","el","isVertical","isClient","key","overflow","getStyle","s","getScrollContainer","parent","scrollBarWidth","getScrollBarWidth","namespace","outer","widthNoScroll","inner","widthWithScroll","_a","scrollIntoView","container","selected","offsetParents","pointer","top","prev","curr","bottom","viewRectTop","viewRectBottom","animateScrollTo","from","to","duration","callback","startTime","handle","scroll","time","nextScrollTop","easeInOutCubic","isWindow","rAF","cAF","getScrollElement","target","getScrollTop"],"mappings":";;;;;AAMa,MAAAA,IAAW,CAACC,GAAiBC,MAAkC;AACtE,MAAA,CAACC,EAAiB,QAAA;AAEtB,QAAMC,IACJ;AAAA,IACE,WAAW;AAAA,IACX,MAAM;AAAA,IACN,OAAO;AAAA,EAAA,EAET,OAAOF,CAAU,CAAC,GACdG,IAAWC,EAASL,GAAIG,CAAG;AAC1B,SAAA,CAAC,UAAU,QAAQ,SAAS,EAAE,KAAK,CAACG,MAAMF,EAAS,SAASE,CAAC,CAAC;AACvE,GAEaC,IAAqB,CAChCP,GACAC,MACqC;AACrC,MAAI,CAACC,EAAU;AAEf,MAAIM,IAAsBR;AAC1B,SAAOQ,KAAQ;AACb,QAAI,CAAC,QAAQ,UAAU,SAAS,eAAe,EAAE,SAASA,CAAM;AACvD,aAAA;AAET,QAAIT,EAASS,GAAQP,CAAU,EAAU,QAAAO;AAEzC,IAAAA,IAASA,EAAO;AAAA,EAClB;AAEO,SAAAA;AACT;AAEA,IAAIC;AACS,MAAAC,IAAoB,CAACC,MAA8B;;AAC1D,MAAA,CAACT,EAAiB,QAAA;AAClB,MAAAO,MAAmB,OAAkB,QAAAA;AAEnC,QAAAG,IAAQ,SAAS,cAAc,KAAK;AACpC,EAAAA,EAAA,YAAY,GAAGD,CAAS,oBAC9BC,EAAM,MAAM,aAAa,UACzBA,EAAM,MAAM,QAAQ,SACpBA,EAAM,MAAM,WAAW,YACvBA,EAAM,MAAM,MAAM,WACT,SAAA,KAAK,YAAYA,CAAK;AAE/B,QAAMC,IAAgBD,EAAM;AAC5B,EAAAA,EAAM,MAAM,WAAW;AAEjB,QAAAE,IAAQ,SAAS,cAAc,KAAK;AAC1C,EAAAA,EAA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AASrB,CAAS,IACbyB,EAAO,cAAc,kBAEvBzB,GAGI0B,IAAe,CAAC1B,MACvBqB,EAASrB,CAAS,IACb,OAAO,UAETA,EAAU;"}
|
1
|
+
{"version":3,"file":"scroll.js","sources":["../../../../src/components/_util/dom/scroll.ts"],"sourcesContent":["import { isClient } from '../browser'\r\nimport { easeInOutCubic } from '../easings'\r\nimport { isWindow } from '../types'\r\nimport { cAF, rAF } from '../raf'\r\nimport { getStyle } from './style'\r\n\r\nexport const isScroll = (el: HTMLElement, isVertical?: boolean): boolean => {\r\n if (!isClient) return false\r\n\r\n const key = (\r\n {\r\n undefined: 'overflow',\r\n true: 'overflow-y',\r\n false: 'overflow-x',\r\n } as const\r\n )[String(isVertical)]!\r\n const overflow = getStyle(el, key)\r\n return ['scroll', 'auto', 'overlay'].some((s) => overflow.includes(s))\r\n}\r\n\r\nexport const getScrollContainer = (\r\n el: HTMLElement,\r\n isVertical?: boolean\r\n): Window | HTMLElement | undefined => {\r\n if (!isClient) return\r\n\r\n let parent: HTMLElement = el\r\n while (parent) {\r\n if ([window, document, document.documentElement].includes(parent))\r\n return window\r\n\r\n if (isScroll(parent, isVertical)) return parent\r\n\r\n parent = parent.parentNode as HTMLElement\r\n }\r\n\r\n return parent\r\n}\r\n\r\nlet scrollBarWidth: number\r\nexport const getScrollBarWidth = (namespace: string): number => {\r\n if (!isClient) return 0\r\n if (scrollBarWidth !== undefined) return scrollBarWidth\r\n\r\n const outer = document.createElement('div')\r\n outer.className = `${namespace}-scrollbar__wrap`\r\n outer.style.visibility = 'hidden'\r\n outer.style.width = '100px'\r\n outer.style.position = 'absolute'\r\n outer.style.top = '-9999px'\r\n document.body.appendChild(outer)\r\n\r\n const widthNoScroll = outer.offsetWidth\r\n outer.style.overflow = 'scroll'\r\n\r\n const inner = document.createElement('div')\r\n inner.style.width = '100%'\r\n outer.appendChild(inner)\r\n\r\n const widthWithScroll = inner.offsetWidth\r\n outer.parentNode?.removeChild(outer)\r\n scrollBarWidth = widthNoScroll - widthWithScroll\r\n\r\n return scrollBarWidth\r\n}\r\n\r\n/**\r\n * Scroll with in the container element, positioning the **selected** element at the top\r\n * of the container\r\n */\r\nexport function scrollIntoView(\r\n container: HTMLElement,\r\n selected: HTMLElement\r\n): void {\r\n if (!isClient) return\r\n\r\n if (!selected) {\r\n container.scrollTop = 0\r\n return\r\n }\r\n\r\n const offsetParents: HTMLElement[] = []\r\n let pointer = selected.offsetParent\r\n while (\r\n pointer !== null &&\r\n container !== pointer &&\r\n container.contains(pointer)\r\n ) {\r\n offsetParents.push(pointer as HTMLElement)\r\n pointer = (pointer as HTMLElement).offsetParent\r\n }\r\n const top =\r\n selected.offsetTop +\r\n offsetParents.reduce((prev, curr) => prev + curr.offsetTop, 0)\r\n const bottom = top + selected.offsetHeight\r\n const viewRectTop = container.scrollTop\r\n const viewRectBottom = viewRectTop + container.clientHeight\r\n\r\n if (top < viewRectTop) {\r\n container.scrollTop = top\r\n } else if (bottom > viewRectBottom) {\r\n container.scrollTop = bottom - container.clientHeight\r\n }\r\n}\r\n\r\nexport function animateScrollTo(\r\n container: HTMLElement | Window,\r\n from: number,\r\n to: number,\r\n duration: number,\r\n callback?: unknown\r\n) {\r\n const startTime = Date.now()\r\n\r\n let handle: number | undefined\r\n const scroll = () => {\r\n const timestamp = Date.now()\r\n const time = timestamp - startTime\r\n const nextScrollTop = easeInOutCubic(\r\n time > duration ? duration : time,\r\n from,\r\n to,\r\n duration\r\n )\r\n\r\n if (isWindow(container)) {\r\n container.scrollTo(window.pageXOffset, nextScrollTop)\r\n } else {\r\n container.scrollTop = nextScrollTop\r\n }\r\n if (time < duration) {\r\n handle = rAF(scroll)\r\n } else if (typeof callback === 'function') {\r\n callback()\r\n }\r\n }\r\n\r\n scroll()\r\n\r\n return () => {\r\n handle && cAF(handle)\r\n }\r\n}\r\n\r\nexport const getScrollElement = (\r\n target: HTMLElement,\r\n container: HTMLElement | Window\r\n) => {\r\n if (isWindow(container)) {\r\n return target.ownerDocument.documentElement\r\n }\r\n return container\r\n}\r\n\r\nexport const getScrollTop = (container: HTMLElement | Window) => {\r\n if (isWindow(container)) {\r\n return window.scrollY\r\n }\r\n return container.scrollTop\r\n}\r\n"],"names":["isScroll","el","isVertical","isClient","key","overflow","getStyle","s","getScrollContainer","parent","scrollBarWidth","getScrollBarWidth","namespace","outer","widthNoScroll","inner","widthWithScroll","_a","scrollIntoView","container","selected","offsetParents","pointer","top","prev","curr","bottom","viewRectTop","viewRectBottom","animateScrollTo","from","to","duration","callback","startTime","handle","scroll","time","nextScrollTop","easeInOutCubic","isWindow","rAF","cAF","getScrollElement","target","getScrollTop"],"mappings":";;;;;AAMa,MAAAA,IAAW,CAACC,GAAiBC,MAAkC;AACtE,MAAA,CAACC,EAAiB,QAAA;AAEtB,QAAMC,IACJ;AAAA,IACE,WAAW;AAAA,IACX,MAAM;AAAA,IACN,OAAO;AAAA,EAAA,EAET,OAAOF,CAAU,CAAC,GACdG,IAAWC,EAASL,GAAIG,CAAG;AAC1B,SAAA,CAAC,UAAU,QAAQ,SAAS,EAAE,KAAK,CAACG,MAAMF,EAAS,SAASE,CAAC,CAAC;AACvE,GAEaC,IAAqB,CAChCP,GACAC,MACqC;AACrC,MAAI,CAACC,EAAU;AAEf,MAAIM,IAAsBR;AAC1B,SAAOQ,KAAQ;AACb,QAAI,CAAC,QAAQ,UAAU,SAAS,eAAe,EAAE,SAASA,CAAM;AACvD,aAAA;AAET,QAAIT,EAASS,GAAQP,CAAU,EAAU,QAAAO;AAEzC,IAAAA,IAASA,EAAO;AAAA,EAClB;AAEO,SAAAA;AACT;AAEA,IAAIC;AACS,MAAAC,IAAoB,CAACC,MAA8B;;AAC1D,MAAA,CAACT,EAAiB,QAAA;AAClB,MAAAO,MAAmB,OAAkB,QAAAA;AAEnC,QAAAG,IAAQ,SAAS,cAAc,KAAK;AACpC,EAAAA,EAAA,YAAY,GAAGD,CAAS,oBAC9BC,EAAM,MAAM,aAAa,UACzBA,EAAM,MAAM,QAAQ,SAC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mB,GAEpBD,IAAOL,IACTG,IAASM,EAAIL,CAAM,IACV,OAAOH,KAAa,cACpBA;EACX;AAGK,SAAAG,KAEA,MAAM;AACX,IAAAD,KAAUO,EAAIP,CAAM;AAAA,EAAA;AAExB;AAEa,MAAAQ,IAAmB,CAC9BC,GACAzB,MAEIqB,EAASrB,CAAS,IACbyB,EAAO,cAAc,kBAEvBzB,GAGI0B,IAAe,CAAC1B,MACvBqB,EAASrB,CAAS,IACb,OAAO,UAETA,EAAU;"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"style.js","sources":["../../../../src/components/_util/dom/style.ts"],"sourcesContent":["import { isNumber, isObject, isString, isStringNumber } from '../types'\nimport { isClient } from '../browser'\nimport { camelize } from '../strings'\nimport { entriesOf, keysOf } from '../objects'\nimport { debugWarn } from '../error'\nimport type { CSSProperties } from 'vue'\n\nconst SCOPE = 'utils/dom/style'\n\nexport const classNameToArray = (cls = '') =>\n cls.split(' ').filter((item) => !!item.trim())\n\nexport const hasClass = (el: Element, cls: string): boolean => {\n if (!el || !cls) return false\n if (cls.includes(' ')) throw new Error('className should not contain space.')\n return el.classList.contains(cls)\n}\n\nexport const addClass = (el: Element, cls: string) => {\n if (!el || !cls.trim()) return\n el.classList.add(...classNameToArray(cls))\n}\n\nexport const removeClass = (el: Element, cls: string) => {\n if (!el || !cls.trim()) return\n el.classList.remove(...classNameToArray(cls))\n}\n\nexport const getStyle = (\n element: HTMLElement,\n styleName: keyof CSSProperties\n): string => {\n if (!isClient || !element || !styleName) return ''\n\n let key = camelize(styleName)\n if (key === 'float') key = 'cssFloat'\n try {\n const style = (element.style as any)[key]\n if (style) return style\n const computed: any = document.defaultView?.getComputedStyle(element, '')\n return computed ? computed[key] : ''\n } catch {\n return (element.style as any)[key]\n }\n}\n\nexport const setStyle = (\n element: HTMLElement,\n styleName: CSSProperties | keyof CSSProperties,\n value?: string | number\n) => {\n if (!element || !styleName) return\n\n if (isObject(styleName)) {\n entriesOf(styleName).forEach(([prop, value]) =>\n setStyle(element, prop, value)\n )\n } else {\n const key: any = camelize(styleName)\n element.style[key] = value as any\n }\n}\n\nexport const removeStyle = (\n element: HTMLElement,\n style: CSSProperties | keyof CSSProperties\n) => {\n if (!element || !style) return\n\n if (isObject(style)) {\n keysOf(style).forEach((prop) => removeStyle(element, prop))\n } else {\n setStyle(element, style, '')\n }\n}\n\nexport function addUnit(value?: string | number, defaultUnit = 'px') {\n if (!value) return ''\n if (isNumber(value) || isStringNumber(value)) {\n return `${value}${defaultUnit}`\n } else if (isString(value)) {\n return value\n }\n debugWarn(SCOPE, 'binding value must be a string or number')\n}\n"],"names":["SCOPE","classNameToArray","cls","item","hasClass","el","addClass","removeClass","getStyle","element","styleName","isClient","key","camelize","style","computed","_a","setStyle","value","isObject","entriesOf","prop","removeStyle","keysOf","addUnit","defaultUnit","isNumber","isStringNumber","isString","debugWarn"],"mappings":";;;;;AAOA,MAAMA,IAAQ,mBAEDC,IAAmB,CAACC,IAAM,OACrCA,EAAI,MAAM,GAAG,EAAE,OAAO,CAACC,MAAS,CAAC,CAACA,EAAK,MAAM,GAElCC,IAAW,CAACC,GAAaH,MAAyB;AAC7D,MAAI,CAACG,KAAM,CAACH,EAAY,QAAA;AACxB,MAAIA,EAAI,SAAS,GAAG,EAAS,OAAA,IAAI,MAAM,qCAAqC;AACrE,SAAAG,EAAG,UAAU,SAASH,CAAG;AAClC,GAEaI,IAAW,CAACD,GAAaH,MAAgB;AACpD,EAAI,CAACG,KAAM,CAACH,EAAI,KAAQ,KACxBG,EAAG,UAAU,IAAI,GAAGJ,EAAiBC,CAAG,CAAC;AAC3C,GAEaK,IAAc,CAACF,GAAaH,MAAgB;AACvD,EAAI,CAACG,KAAM,CAACH,EAAI,KAAQ,KACxBG,EAAG,UAAU,OAAO,GAAGJ,EAAiBC,CAAG,CAAC;AAC9C,GAEaM,IAAW,CACtBC,GACAC,MACW;;AACX,MAAI,CAACC,KAAY,CAACF,KAAW,CAACC,EAAkB,QAAA;AAE5C,MAAAE,IAAMC,EAASH,CAAS;AACxB,EAAAE,MAAQ,YAAeA,IAAA;AACvB,MAAA;AACI,UAAAE,IAASL,EAAQ,MAAcG,CAAG;AACxC,QAAIE,EAAc,QAAAA;AAClB,UAAMC,KAAgBC,IAAA,SAAS,gBAAT,gBAAAA,EAAsB,iBAAiBP,GAAS;AAC/D,WAAAM,IAAWA,EAASH,CAAG,IAAI;AAAA,EAAA,QAC5B;AACE,WAAAH,EAAQ,MAAcG,CAAG;AAAA,EACnC;AACF,GAEaK,IAAW,CACtBR,GACAC,GACAQ,MACG;AACC,MAAA,GAACT,KAAW,CAACC;AAEb,QAAAS,EAAST,CAAS;AACpB,MAAAU,EAAUV,CAAS,EAAE;AAAA,QAAQ,CAAC,CAACW,GAAMH,CAAK,MACxCD,EAASR,GAASY,GAAMH,CAAK;AAAA,MAAA;AAAA,SAE1B;AACC,YAAAN,IAAWC,EAASH,CAAS;AAC3B,MAAAD,EAAA,MAAMG,CAAG,IAAIM;AAAA,IACvB;AACF,GAEaI,IAAc,CACzBb,GACAK,MACG;AACC,EAAA,CAACL,KAAW,CAACK,MAEbK,EAASL,CAAK,IACTS,EAAAT,CAAK,EAAE,QAAQ,CAACO,MAASC,EAAYb,GAASY,CAAI,CAAC,IAEjDJ,EAAAR,GAASK,GAAO,EAAE;AAE/B;AAEgB,SAAAU,EAAQN,GAAyBO,IAAc,MAAM;AAC/D,MAAA,CAACP,EAAc,QAAA;AACnB,MAAIQ,EAASR,CAAK,KAAKS,EAAeT,CAAK;AAClC,WAAA,GAAGA,CAAK,GAAGO,CAAW;AAC/B,MAAWG,EAASV,CAAK;AAChB,WAAAA;AAET,EAAAW,EAAU7B,GAAO,0CAA0C;AAC7D;"}
|
1
|
+
{"version":3,"file":"style.js","sources":["../../../../src/components/_util/dom/style.ts"],"sourcesContent":["import { isNumber, isObject, isString, isStringNumber } from '../types'\r\nimport { isClient } from '../browser'\r\nimport { camelize } from '../strings'\r\nimport { entriesOf, keysOf } from '../objects'\r\nimport { debugWarn } from '../error'\r\nimport type { CSSProperties } from 'vue'\r\n\r\nconst SCOPE = 'utils/dom/style'\r\n\r\nexport const classNameToArray = (cls = '') =>\r\n cls.split(' ').filter((item) => !!item.trim())\r\n\r\nexport const hasClass = (el: Element, cls: string): boolean => {\r\n if (!el || !cls) return false\r\n if (cls.includes(' ')) throw new Error('className should not contain space.')\r\n return el.classList.contains(cls)\r\n}\r\n\r\nexport const addClass = (el: Element, cls: string) => {\r\n if (!el || !cls.trim()) return\r\n el.classList.add(...classNameToArray(cls))\r\n}\r\n\r\nexport const removeClass = (el: Element, cls: string) => {\r\n if (!el || !cls.trim()) return\r\n el.classList.remove(...classNameToArray(cls))\r\n}\r\n\r\nexport const getStyle = (\r\n element: HTMLElement,\r\n styleName: keyof CSSProperties\r\n): string => {\r\n if (!isClient || !element || !styleName) return ''\r\n\r\n let key = camelize(styleName)\r\n if (key === 'float') key = 'cssFloat'\r\n try {\r\n const style = (element.style as any)[key]\r\n if (style) return style\r\n const computed: any = document.defaultView?.getComputedStyle(element, '')\r\n return computed ? computed[key] : ''\r\n } catch {\r\n return (element.style as any)[key]\r\n }\r\n}\r\n\r\nexport const setStyle = (\r\n element: HTMLElement,\r\n styleName: CSSProperties | keyof CSSProperties,\r\n value?: string | number\r\n) => {\r\n if (!element || !styleName) return\r\n\r\n if (isObject(styleName)) {\r\n entriesOf(styleName).forEach(([prop, value]) =>\r\n setStyle(element, prop, value)\r\n )\r\n } else {\r\n const key: any = camelize(styleName)\r\n element.style[key] = value as any\r\n }\r\n}\r\n\r\nexport const removeStyle = (\r\n element: HTMLElement,\r\n style: CSSProperties | keyof CSSProperties\r\n) => {\r\n if (!element || !style) return\r\n\r\n if (isObject(style)) {\r\n keysOf(style).forEach((prop) => removeStyle(element, prop))\r\n } else {\r\n setStyle(element, style, '')\r\n }\r\n}\r\n\r\nexport function addUnit(value?: string | number, defaultUnit = 'px') {\r\n if (!value) return ''\r\n if (isNumber(value) || isStringNumber(value)) {\r\n return `${value}${defaultUnit}`\r\n } else if (isString(value)) {\r\n return value\r\n }\r\n debugWarn(SCOPE, 'binding value must be a string or number')\r\n}\r\n"],"names":["SCOPE","classNameToArray","cls","item","hasClass","el","addClass","removeClass","getStyle","element","styleName","isClient","key","camelize","style","computed","_a","setStyle","value","isObject","entriesOf","prop","removeStyle","keysOf","addUnit","defaultUnit","isNumber","isStringNumber","isString","debugWarn"],"mappings":";;;;;AAOA,MAAMA,IAAQ,mBAEDC,IAAmB,CAACC,IAAM,OACrCA,EAAI,MAAM,GAAG,EAAE,OAAO,CAACC,MAAS,CAAC,CAACA,EAAK,MAAM,GAElCC,IAAW,CAACC,GAAaH,MAAyB;AAC7D,MAAI,CAACG,KAAM,CAACH,EAAY,QAAA;AACxB,MAAIA,EAAI,SAAS,GAAG,EAAS,OAAA,IAAI,MAAM,qCAAqC;AACrE,SAAAG,EAAG,UAAU,SAASH,CAAG;AAClC,GAEaI,IAAW,CAACD,GAAaH,MAAgB;AACpD,EAAI,CAACG,KAAM,CAACH,EAAI,KAAQ,KACxBG,EAAG,UAAU,IAAI,GAAGJ,EAAiBC,CAAG,CAAC;AAC3C,GAEaK,IAAc,CAACF,GAAaH,MAAgB;AACvD,EAAI,CAACG,KAAM,CAACH,EAAI,KAAQ,KACxBG,EAAG,UAAU,OAAO,GAAGJ,EAAiBC,CAAG,CAAC;AAC9C,GAEaM,IAAW,CACtBC,GACAC,MACW;;AACX,MAAI,CAACC,KAAY,CAACF,KAAW,CAACC,EAAkB,QAAA;AAE5C,MAAAE,IAAMC,EAASH,CAAS;AACxB,EAAAE,MAAQ,YAAeA,IAAA;AACvB,MAAA;AACI,UAAAE,IAASL,EAAQ,MAAcG,CAAG;AACxC,QAAIE,EAAc,QAAAA;AAClB,UAAMC,KAAgBC,IAAA,SAAS,gBAAT,gBAAAA,EAAsB,iBAAiBP,GAAS;AAC/D,WAAAM,IAAWA,EAASH,CAAG,IAAI;AAAA,EAAA,QAC5B;AACE,WAAAH,EAAQ,MAAcG,CAAG;AAAA,EACnC;AACF,GAEaK,IAAW,CACtBR,GACAC,GACAQ,MACG;AACC,MAAA,GAACT,KAAW,CAACC;AAEb,QAAAS,EAAST,CAAS;AACpB,MAAAU,EAAUV,CAAS,EAAE;AAAA,QAAQ,CAAC,CAACW,GAAMH,CAAK,MACxCD,EAASR,GAASY,GAAMH,CAAK;AAAA,MAAA;AAAA,SAE1B;AACC,YAAAN,IAAWC,EAASH,CAAS;AAC3B,MAAAD,EAAA,MAAMG,CAAG,IAAIM;AAAA,IACvB;AACF,GAEaI,IAAc,CACzBb,GACAK,MACG;AACC,EAAA,CAACL,KAAW,CAACK,MAEbK,EAASL,CAAK,IACTS,EAAAT,CAAK,EAAE,QAAQ,CAACO,MAASC,EAAYb,GAASY,CAAI,CAAC,IAEjDJ,EAAAR,GAASK,GAAO,EAAE;AAE/B;AAEgB,SAAAU,EAAQN,GAAyBO,IAAc,MAAM;AAC/D,MAAA,CAACP,EAAc,QAAA;AACnB,MAAIQ,EAASR,CAAK,KAAKS,EAAeT,CAAK;AAClC,WAAA,GAAGA,CAAK,GAAGO,CAAW;AAC/B,MAAWG,EAASV,CAAK;AAChB,WAAAA;AAET,EAAAW,EAAU7B,GAAO,0CAA0C;AAC7D;"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"easings.js","sources":["../../../src/components/_util/easings.ts"],"sourcesContent":["export function easeInOutCubic(t: number, b: number, c: number, d: number) {\n const cc = c - b\n t /= d / 2\n if (t < 1) {\n return (cc / 2) * t * t * t + b\n }\n return (cc / 2) * ((t -= 2) * t * t + 2) + b\n}\n"],"names":["easeInOutCubic","t","b","c","d","cc"],"mappings":"AAAO,SAASA,EAAeC,GAAWC,GAAWC,GAAWC,GAAW;AACzE,QAAMC,IAAKF,IAAID;AAEf,SADAD,KAAKG,IAAI,GACLH,IAAI,IACEI,IAAK,IAAKJ,IAAIA,IAAIA,IAAIC,IAExBG,IAAK,MAAOJ,KAAK,KAAKA,IAAIA,IAAI,KAAKC;AAC7C;"}
|
1
|
+
{"version":3,"file":"easings.js","sources":["../../../src/components/_util/easings.ts"],"sourcesContent":["export function easeInOutCubic(t: number, b: number, c: number, d: number) {\r\n const cc = c - b\r\n t /= d / 2\r\n if (t < 1) {\r\n return (cc / 2) * t * t * t + b\r\n }\r\n return (cc / 2) * ((t -= 2) * t * t + 2) + b\r\n}\r\n"],"names":["easeInOutCubic","t","b","c","d","cc"],"mappings":"AAAO,SAASA,EAAeC,GAAWC,GAAWC,GAAWC,GAAW;AACzE,QAAMC,IAAKF,IAAID;AAEf,SADAD,KAAKG,IAAI,GACLH,IAAI,IACEI,IAAK,IAAKJ,IAAIA,IAAIA,IAAIC,IAExBG,IAAK,MAAOJ,KAAK,KAAKA,IAAIA,IAAI,KAAKC;AAC7C;"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"error.js","sources":["../../../src/components/_util/error.ts"],"sourcesContent":["import { isString } from './types'\n\nclass ElementPlusError extends Error {\n constructor(m: string) {\n super(m)\n this.name = 'ElementPlusError'\n }\n}\n\nexport function throwError(scope: string, m: string): never {\n throw new ElementPlusError(`[${scope}] ${m}`)\n}\n\nexport function debugWarn(err: Error): void\nexport function debugWarn(scope: string, message: string): void\nexport function debugWarn(scope: string | Error, message?: string): void {\n if (process.env.NODE_ENV !== 'production') {\n const error: Error = isString(scope)\n ? new ElementPlusError(`[${scope}] ${message}`)\n : scope\n // eslint-disable-next-line no-console\n console.warn(error)\n }\n}\n"],"names":["ElementPlusError","m","throwError","scope","debugWarn","message","error","isString"],"mappings":";;;AAEA,MAAMA,UAAyB,MAAM;AAAA,EACnC,YAAYC,GAAW;AACrB,UAAMA,CAAC,GACP,KAAK,OAAO;AAAA,EACd;AACF;AAEgB,SAAAC,EAAWC,GAAeF,GAAkB;AAC1D,QAAM,IAAID,EAAiB,IAAIG,CAAK,KAAKF,CAAC,EAAE;AAC9C;AAIgB,SAAAG,EAAUD,GAAuBE,GAAwB;AACnE,MAAA,QAAQ,IAAI,aAAa,cAAc;AACnC,UAAAC,IAAeC,EAASJ,CAAK,IAC/B,IAAIH,EAAiB,IAAIG,CAAK,KAAKE,CAAO,EAAE,IAC5CF;AAEJ,YAAQ,KAAKG,CAAK;AAAA,EACpB;AACF;"}
|
1
|
+
{"version":3,"file":"error.js","sources":["../../../src/components/_util/error.ts"],"sourcesContent":["import { isString } from './types'\r\n\r\nclass ElementPlusError extends Error {\r\n constructor(m: string) {\r\n super(m)\r\n this.name = 'ElementPlusError'\r\n }\r\n}\r\n\r\nexport function throwError(scope: string, m: string): never {\r\n throw new ElementPlusError(`[${scope}] ${m}`)\r\n}\r\n\r\nexport function debugWarn(err: Error): void\r\nexport function debugWarn(scope: string, message: string): void\r\nexport function debugWarn(scope: string | Error, message?: string): void {\r\n if (process.env.NODE_ENV !== 'production') {\r\n const error: Error = isString(scope)\r\n ? new ElementPlusError(`[${scope}] ${message}`)\r\n : scope\r\n // eslint-disable-next-line no-console\r\n console.warn(error)\r\n }\r\n}\r\n"],"names":["ElementPlusError","m","throwError","scope","debugWarn","message","error","isString"],"mappings":";;;AAEA,MAAMA,UAAyB,MAAM;AAAA,EACnC,YAAYC,GAAW;AACrB,UAAMA,CAAC,GACP,KAAK,OAAO;AAAA,EACd;AACF;AAEgB,SAAAC,EAAWC,GAAeF,GAAkB;AAC1D,QAAM,IAAID,EAAiB,IAAIG,CAAK,KAAKF,CAAC,EAAE;AAC9C;AAIgB,SAAAG,EAAUD,GAAuBE,GAAwB;AACnE,MAAA,QAAQ,IAAI,aAAa,cAAc;AACnC,UAAAC,IAAeC,EAASJ,CAAK,IAC/B,IAAIH,EAAiB,IAAIG,CAAK,KAAKE,CAAO,EAAE,IAC5CF;AAEJ,YAAQ,KAAKG,CAAK;AAAA,EACpB;AACF;"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"i18n.js","sources":["../../../src/components/_util/i18n.ts"],"sourcesContent":["export const isKorean = (text: string) =>\n /([\\uAC00-\\uD7AF\\u3130-\\u318F])+/gi.test(text)\n"],"names":["isKorean","text"],"mappings":"AAAO,MAAMA,IAAW,CAACC,MACvB,oCAAoC,KAAKA,CAAI;"}
|
1
|
+
{"version":3,"file":"i18n.js","sources":["../../../src/components/_util/i18n.ts"],"sourcesContent":["export const isKorean = (text: string) =>\r\n /([\\uAC00-\\uD7AF\\u3130-\\u318F])+/gi.test(text)\r\n"],"names":["isKorean","text"],"mappings":"AAAO,MAAMA,IAAW,CAACC,MACvB,oCAAoC,KAAKA,CAAI;"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"objects.js","sources":["../../../src/components/_util/objects.ts"],"sourcesContent":["import { get, set } from 'lodash-unified'\nimport type { Entries } from 'type-fest'\nimport type { Arrayable } from '.'\n\nexport const keysOf = <T>(arr: T) => Object.keys(arr) as Array<keyof T>\nexport const entriesOf = <T>(arr: T) => Object.entries(arr) as Entries<T>\nexport { hasOwn } from '@vue/shared'\n\nexport const getProp = <T = any>(\n obj: Record<string, any>,\n path: Arrayable<string>,\n defaultValue?: any\n): { value: T } => {\n return {\n get value() {\n return get(obj, path, defaultValue)\n },\n set value(val: any) {\n set(obj, path, val)\n },\n }\n}\n"],"names":["keysOf","arr","entriesOf","getProp","obj","path","defaultValue","get","val","set"],"mappings":";;AAIO,MAAMA,IAAS,CAAIC,MAAW,OAAO,KAAKA,CAAG,GACvCC,IAAY,CAAID,MAAW,OAAO,QAAQA,CAAG,GAG7CE,IAAU,CACrBC,GACAC,GACAC,OAEO;AAAA,EACL,IAAI,QAAQ;AACH,WAAAC,EAAIH,GAAKC,GAAMC,CAAY;AAAA,EACpC;AAAA,EACA,IAAI,MAAME,GAAU;AACd,IAAAC,EAAAL,GAAKC,GAAMG,CAAG;AAAA,EACpB;AAAA;"}
|
1
|
+
{"version":3,"file":"objects.js","sources":["../../../src/components/_util/objects.ts"],"sourcesContent":["import { get, set } from 'lodash-unified'\r\nimport type { Entries } from 'type-fest'\r\nimport type { Arrayable } from '.'\r\n\r\nexport const keysOf = <T>(arr: T) => Object.keys(arr) as Array<keyof T>\r\nexport const entriesOf = <T>(arr: T) => Object.entries(arr) as Entries<T>\r\nexport { hasOwn } from '@vue/shared'\r\n\r\nexport const getProp = <T = any>(\r\n obj: Record<string, any>,\r\n path: Arrayable<string>,\r\n defaultValue?: any\r\n): { value: T } => {\r\n return {\r\n get value() {\r\n return get(obj, path, defaultValue)\r\n },\r\n set value(val: any) {\r\n set(obj, path, val)\r\n },\r\n }\r\n}\r\n"],"names":["keysOf","arr","entriesOf","getProp","obj","path","defaultValue","get","val","set"],"mappings":";;AAIO,MAAMA,IAAS,CAAIC,MAAW,OAAO,KAAKA,CAAG,GACvCC,IAAY,CAAID,MAAW,OAAO,QAAQA,CAAG,GAG7CE,IAAU,CACrBC,GACAC,GACAC,OAEO;AAAA,EACL,IAAI,QAAQ;AACH,WAAAC,EAAIH,GAAKC,GAAMC,CAAY;AAAA,EACpC;AAAA,EACA,IAAI,MAAME,GAAU;AACd,IAAAC,EAAAL,GAAKC,GAAMG,CAAG;AAAA,EACpB;AAAA;"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"raf.js","sources":["../../../src/components/_util/raf.ts"],"sourcesContent":["import { isClient } from './browser'\n\nexport const rAF = (fn: () => void) =>\n isClient\n ? window.requestAnimationFrame(fn)\n : (setTimeout(fn, 16) as unknown as number)\n\nexport const cAF = (handle: number) =>\n isClient ? window.cancelAnimationFrame(handle) : clearTimeout(handle)\n"],"names":["rAF","fn","isClient","cAF","handle"],"mappings":";AAEa,MAAAA,IAAM,CAACC,MAClBC,IACI,OAAO,sBAAsBD,CAAE,IAC9B,WAAWA,GAAI,EAAE,GAEXE,IAAM,CAACC,MAClBF,IAAW,OAAO,qBAAqBE,CAAM,IAAI,aAAaA,CAAM;"}
|
1
|
+
{"version":3,"file":"raf.js","sources":["../../../src/components/_util/raf.ts"],"sourcesContent":["import { isClient } from './browser'\r\n\r\nexport const rAF = (fn: () => void) =>\r\n isClient\r\n ? window.requestAnimationFrame(fn)\r\n : (setTimeout(fn, 16) as unknown as number)\r\n\r\nexport const cAF = (handle: number) =>\r\n isClient ? window.cancelAnimationFrame(handle) : clearTimeout(handle)\r\n"],"names":["rAF","fn","isClient","cAF","handle"],"mappings":";AAEa,MAAAA,IAAM,CAACC,MAClBC,IACI,OAAO,sBAAsBD,CAAE,IAC9B,WAAWA,GAAI,EAAE,GAEXE,IAAM,CAACC,MAClBF,IAAW,OAAO,qBAAqBE,CAAM,IAAI,aAAaA,CAAM;"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"rand.js","sources":["../../../src/components/_util/rand.ts"],"sourcesContent":["/**\n * @deprecated Use `useId` `useIdInjection` instead\n * Generate random number in range [0, 1000]\n * Maybe replace with [uuid](https://www.npmjs.com/package/uuid)\n */\nexport const generateId = (): number => Math.floor(Math.random() * 10000)\n\n/**\n * @deprecated\n * Generating a random int in range (0, max - 1)\n * @param max {number}\n */\nexport const getRandomInt = (max: number) =>\n Math.floor(Math.random() * Math.floor(max))\n"],"names":["generateId","getRandomInt","max"],"mappings":"AAKO,MAAMA,IAAa,MAAc,KAAK,MAAM,KAAK,WAAW,GAAK,GAO3DC,IAAe,CAACC,MAC3B,KAAK,MAAM,KAAK,WAAW,KAAK,MAAMA,CAAG,CAAC;"}
|
1
|
+
{"version":3,"file":"rand.js","sources":["../../../src/components/_util/rand.ts"],"sourcesContent":["/**\r\n * @deprecated Use `useId` `useIdInjection` instead\r\n * Generate random number in range [0, 1000]\r\n * Maybe replace with [uuid](https://www.npmjs.com/package/uuid)\r\n */\r\nexport const generateId = (): number => Math.floor(Math.random() * 10000)\r\n\r\n/**\r\n * @deprecated\r\n * Generating a random int in range (0, max - 1)\r\n * @param max {number}\r\n */\r\nexport const getRandomInt = (max: number) =>\r\n Math.floor(Math.random() * Math.floor(max))\r\n"],"names":["generateId","getRandomInt","max"],"mappings":"AAKO,MAAMA,IAAa,MAAc,KAAK,MAAM,KAAK,WAAW,GAAK,GAO3DC,IAAe,CAACC,MAC3B,KAAK,MAAM,KAAK,WAAW,KAAK,MAAMA,CAAG,CAAC;"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"strings.js","sources":["../../../src/components/_util/strings.ts"],"sourcesContent":["import { capitalize as toCapitalize } from '@vue/shared'\nexport {\n camelize,\n hyphenate,\n hyphenate as kebabCase, // alias\n} from '@vue/shared'\n\n/**\n * fork from {@link https://github.com/sindresorhus/escape-string-regexp}\n */\nexport const escapeStringRegexp = (string = '') =>\n string.replace(/[|\\\\{}()[\\]^$+*?.]/g, '\\\\$&').replace(/-/g, '\\\\x2d')\n\n// NOTE: improve capitalize types. Restore previous code after the [PR](https://github.com/vuejs/core/pull/6212) merge\nexport const capitalize = <T extends string>(str: T) =>\n toCapitalize(str) as Capitalize<T>\n"],"names":["escapeStringRegexp","string","capitalize","str","toCapitalize"],"mappings":";;AAUa,MAAAA,IAAqB,CAACC,IAAS,OAC1CA,EAAO,QAAQ,uBAAuB,MAAM,EAAE,QAAQ,MAAM,OAAO,GAGxDC,IAAa,CAAmBC,MAC3CC,EAAaD,CAAG;"}
|
1
|
+
{"version":3,"file":"strings.js","sources":["../../../src/components/_util/strings.ts"],"sourcesContent":["import { capitalize as toCapitalize } from '@vue/shared'\r\nexport {\r\n camelize,\r\n hyphenate,\r\n hyphenate as kebabCase, // alias\r\n} from '@vue/shared'\r\n\r\n/**\r\n * fork from {@link https://github.com/sindresorhus/escape-string-regexp}\r\n */\r\nexport const escapeStringRegexp = (string = '') =>\r\n string.replace(/[|\\\\{}()[\\]^$+*?.]/g, '\\\\$&').replace(/-/g, '\\\\x2d')\r\n\r\n// NOTE: improve capitalize types. Restore previous code after the [PR](https://github.com/vuejs/core/pull/6212) merge\r\nexport const capitalize = <T extends string>(str: T) =>\r\n toCapitalize(str) as Capitalize<T>\r\n"],"names":["escapeStringRegexp","string","capitalize","str","toCapitalize"],"mappings":";;AAUa,MAAAA,IAAqB,CAACC,IAAS,OAC1CA,EAAO,QAAQ,uBAAuB,MAAM,EAAE,QAAQ,MAAM,OAAO,GAGxDC,IAAa,CAAmBC,MAC3CC,EAAaD,CAAG;"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"throttleByRaf.js","sources":["../../../src/components/_util/throttleByRaf.ts"],"sourcesContent":["import { cAF, rAF } from './raf'\n\nexport function throttleByRaf(cb: (...args: any[]) => void) {\n let timer = 0\n\n const throttle = (...args: any[]): void => {\n if (timer) {\n cAF(timer)\n }\n timer = rAF(() => {\n cb(...args)\n timer = 0\n })\n }\n\n throttle.cancel = () => {\n cAF(timer)\n timer = 0\n }\n\n return throttle\n}\n"],"names":["throttleByRaf","cb","timer","throttle","args","cAF","rAF"],"mappings":";AAEO,SAASA,EAAcC,GAA8B;AAC1D,MAAIC,IAAQ;AAEN,QAAAC,IAAW,IAAIC,MAAsB;AACzC,IAAIF,KACFG,EAAIH,CAAK,GAEXA,IAAQI,EAAI,MAAM;AAChB,MAAAL,EAAG,GAAGG,CAAI,GACFF,IAAA;AAAA,IAAA,CACT;AAAA,EAAA;AAGH,SAAAC,EAAS,SAAS,MAAM;AACtB,IAAAE,EAAIH,CAAK,GACDA,IAAA;AAAA,EAAA,GAGHC;AACT;"}
|
1
|
+
{"version":3,"file":"throttleByRaf.js","sources":["../../../src/components/_util/throttleByRaf.ts"],"sourcesContent":["import { cAF, rAF } from './raf'\r\n\r\nexport function throttleByRaf(cb: (...args: any[]) => void) {\r\n let timer = 0\r\n\r\n const throttle = (...args: any[]): void => {\r\n if (timer) {\r\n cAF(timer)\r\n }\r\n timer = rAF(() => {\r\n cb(...args)\r\n timer = 0\r\n })\r\n }\r\n\r\n throttle.cancel = () => {\r\n cAF(timer)\r\n timer = 0\r\n }\r\n\r\n return throttle\r\n}\r\n"],"names":["throttleByRaf","cb","timer","throttle","args","cAF","rAF"],"mappings":";AAEO,SAASA,EAAcC,GAA8B;AAC1D,MAAIC,IAAQ;AAEN,QAAAC,IAAW,IAAIC,MAAsB;AACzC,IAAIF,KACFG,EAAIH,CAAK,GAEXA,IAAQI,EAAI,MAAM;AAChB,MAAAL,EAAG,GAAGG,CAAI,GACFF,IAAA;AAAA,IAAA,CACT;AAAA,EAAA;AAGH,SAAAC,EAAS,SAAS,MAAM;AACtB,IAAAE,EAAIH,CAAK,GACDA,IAAA;AAAA,EAAA,GAGHC;AACT;"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"types.js","sources":["../../../src/components/_util/types.ts"],"sourcesContent":["import { isArray, isObject, isString } from '@vue/shared'\nimport { isNil } from 'lodash-unified'\n\nexport {\n isArray,\n isFunction,\n isObject,\n isString,\n isDate,\n isPromise,\n isSymbol,\n isPlainObject,\n} from '@vue/shared'\nexport { isVNode } from 'vue'\n\nexport const isUndefined = (val: any): val is undefined => val === undefined\nexport const isBoolean = (val: any): val is boolean => typeof val === 'boolean'\nexport const isNumber = (val: any): val is number => typeof val === 'number'\n\nexport const isEmpty = (val: unknown) =>\n (!val && val !== 0) ||\n (isArray(val) && val.length === 0) ||\n (isObject(val) && !Object.keys(val).length)\n\nexport const isElement = (e: unknown): e is Element => {\n if (typeof Element === 'undefined') return false\n return e instanceof Element\n}\n\nexport const isPropAbsent = (prop: unknown): prop is null | undefined => {\n return isNil(prop)\n}\n\nexport const isStringNumber = (val: string): boolean => {\n if (!isString(val)) {\n return false\n }\n return !Number.isNaN(Number(val))\n}\n\nexport const isWindow = (val: unknown): val is Window => {\n return val === window\n}\n"],"names":["isUndefined","val","isBoolean","isNumber","isEmpty","isArray","isObject","isElement","isPropAbsent","prop","isNil","isStringNumber","isString","isWindow"],"mappings":";;;;AAea,MAAAA,IAAc,CAACC,MAA+BA,MAAQ,QACtDC,IAAY,CAACD,MAA6B,OAAOA,KAAQ,WACzDE,IAAW,CAACF,MAA4B,OAAOA,KAAQ,UAEvDG,IAAU,CAACH,MACrB,CAACA,KAAOA,MAAQ,KAChBI,EAAQJ,CAAG,KAAKA,EAAI,WAAW,KAC/BK,EAASL,CAAG,KAAK,CAAC,OAAO,KAAKA,CAAG,EAAE,QAEzBM,IAAY,CAAC,MACpB,OAAO,UAAY,MAAoB,KACpC,aAAa,SAGTC,IAAe,CAACC,MACpBC,EAAMD,CAAI,GAGNE,IAAiB,CAACV,MACxBW,EAASX,CAAG,IAGV,CAAC,OAAO,MAAM,OAAOA,CAAG,CAAC,IAFvB,IAKEY,IAAW,CAACZ,MAChBA,MAAQ;"}
|
1
|
+
{"version":3,"file":"types.js","sources":["../../../src/components/_util/types.ts"],"sourcesContent":["import { isArray, isObject, isString } from '@vue/shared'\r\nimport { isNil } from 'lodash-unified'\r\n\r\nexport {\r\n isArray,\r\n isFunction,\r\n isObject,\r\n isString,\r\n isDate,\r\n isPromise,\r\n isSymbol,\r\n isPlainObject,\r\n} from '@vue/shared'\r\nexport { isVNode } from 'vue'\r\n\r\nexport const isUndefined = (val: any): val is undefined => val === undefined\r\nexport const isBoolean = (val: any): val is boolean => typeof val === 'boolean'\r\nexport const isNumber = (val: any): val is number => typeof val === 'number'\r\n\r\nexport const isEmpty = (val: unknown) =>\r\n (!val && val !== 0) ||\r\n (isArray(val) && val.length === 0) ||\r\n (isObject(val) && !Object.keys(val).length)\r\n\r\nexport const isElement = (e: unknown): e is Element => {\r\n if (typeof Element === 'undefined') return false\r\n return e instanceof Element\r\n}\r\n\r\nexport const isPropAbsent = (prop: unknown): prop is null | undefined => {\r\n return isNil(prop)\r\n}\r\n\r\nexport const isStringNumber = (val: string): boolean => {\r\n if (!isString(val)) {\r\n return false\r\n }\r\n return !Number.isNaN(Number(val))\r\n}\r\n\r\nexport const isWindow = (val: unknown): val is Window => {\r\n return val === window\r\n}\r\n"],"names":["isUndefined","val","isBoolean","isNumber","isEmpty","isArray","isObject","isElement","isPropAbsent","prop","isNil","isStringNumber","isString","isWindow"],"mappings":";;;;AAea,MAAAA,IAAc,CAACC,MAA+BA,MAAQ,QACtDC,IAAY,CAACD,MAA6B,OAAOA,KAAQ,WACzDE,IAAW,CAACF,MAA4B,OAAOA,KAAQ,UAEvDG,IAAU,CAACH,MACrB,CAACA,KAAOA,MAAQ,KAChBI,EAAQJ,CAAG,KAAKA,EAAI,WAAW,KAC/BK,EAASL,CAAG,KAAK,CAAC,OAAO,KAAKA,CAAG,EAAE,QAEzBM,IAAY,CAAC,MACpB,OAAO,UAAY,MAAoB,KACpC,aAAa,SAGTC,IAAe,CAACC,MACpBC,EAAMD,CAAI,GAGNE,IAAiB,CAACV,MACxBW,EAASX,CAAG,IAGV,CAAC,OAAO,MAAM,OAAOA,CAAG,CAAC,IAFvB,IAKEY,IAAW,CAACZ,MAChBA,MAAQ;"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"typescript.js","sources":["../../../src/components/_util/typescript.ts"],"sourcesContent":["export const mutable = <T extends readonly any[] | Record<string, unknown>>(\n val: T\n) => val as Mutable<typeof val>\nexport type Mutable<T> = { -readonly [P in keyof T]: T[P] }\n\nexport type HTMLElementCustomized<T> = HTMLElement & T\n\n/**\n * @deprecated stop to use null\n * @see {@link https://github.com/sindresorhus/meta/discussions/7}\n */\nexport type Nullable<T> = T | null\n\nexport type Arrayable<T> = T | T[]\nexport type Awaitable<T> = Promise<T> | T\n"],"names":["mutable","val"],"mappings":"AAAa,MAAAA,IAAU,CACrBC,MACGA;"}
|
1
|
+
{"version":3,"file":"typescript.js","sources":["../../../src/components/_util/typescript.ts"],"sourcesContent":["export const mutable = <T extends readonly any[] | Record<string, unknown>>(\r\n val: T\r\n) => val as Mutable<typeof val>\r\nexport type Mutable<T> = { -readonly [P in keyof T]: T[P] }\r\n\r\nexport type HTMLElementCustomized<T> = HTMLElement & T\r\n\r\n/**\r\n * @deprecated stop to use null\r\n * @see {@link https://github.com/sindresorhus/meta/discussions/7}\r\n */\r\nexport type Nullable<T> = T | null\r\n\r\nexport type Arrayable<T> = T | T[]\r\nexport type Awaitable<T> = Promise<T> | T\r\n"],"names":["mutable","val"],"mappings":"AAAa,MAAAA,IAAU,CACrBC,MACGA;"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"global-node.js","sources":["../../../../src/components/_util/vue/global-node.ts"],"sourcesContent":["import { isClient } from '../browser'\n\nconst globalNodes: HTMLElement[] = []\nlet target: HTMLElement | undefined = !isClient ? undefined : document.body\n\nexport function createGlobalNode(id?: string) {\n const el = document.createElement('div')\n if (id !== undefined) {\n el.setAttribute('id', id)\n }\n\n if (target) {\n target.appendChild(el)\n globalNodes.push(el)\n }\n\n return el\n}\n\nexport function removeGlobalNode(el: HTMLElement) {\n globalNodes.splice(globalNodes.indexOf(el), 1)\n el.remove()\n}\n\nexport function changeGlobalNodesTarget(el: HTMLElement) {\n if (el === target) return\n\n target = el\n globalNodes.forEach((el) => {\n if (target && !el.contains(target)) {\n target.appendChild(el)\n }\n })\n}\n"],"names":["globalNodes","target","isClient","createGlobalNode","id","el","removeGlobalNode","changeGlobalNodesTarget"],"mappings":";AAEA,MAAMA,IAA6B,CAAA;AACnC,IAAIC,IAAmCC,IAAuB,SAAS,OAArB;AAE3C,SAASC,EAAiBC,GAAa;AACtC,QAAAC,IAAK,SAAS,cAAc,KAAK;AACvC,SAAID,MAAO,UACNC,EAAA,aAAa,MAAMD,CAAE,GAGtBH,MACFA,EAAO,YAAYI,CAAE,GACrBL,EAAY,KAAKK,CAAE,IAGdA;AACT;AAEO,SAASC,EAAiBD,GAAiB;AAChD,EAAAL,EAAY,OAAOA,EAAY,QAAQK,CAAE,GAAG,CAAC,GAC7CA,EAAG,OAAO;AACZ;AAEO,SAASE,EAAwBF,GAAiB;AACvD,EAAIA,MAAOJ,MAEFA,IAAAI,GACGL,EAAA,QAAQ,CAACK,MAAO;AAC1B,IAAIJ,KAAU,CAACI,EAAG,SAASJ,CAAM,KAC/BA,EAAO,YAAYI,CAAE;AAAA,EACvB,CACD;AACH;"}
|
1
|
+
{"version":3,"file":"global-node.js","sources":["../../../../src/components/_util/vue/global-node.ts"],"sourcesContent":["import { isClient } from '../browser'\r\n\r\nconst globalNodes: HTMLElement[] = []\r\nlet target: HTMLElement | undefined = !isClient ? undefined : document.body\r\n\r\nexport function createGlobalNode(id?: string) {\r\n const el = document.createElement('div')\r\n if (id !== undefined) {\r\n el.setAttribute('id', id)\r\n }\r\n\r\n if (target) {\r\n target.appendChild(el)\r\n globalNodes.push(el)\r\n }\r\n\r\n return el\r\n}\r\n\r\nexport function removeGlobalNode(el: HTMLElement) {\r\n globalNodes.splice(globalNodes.indexOf(el), 1)\r\n el.remove()\r\n}\r\n\r\nexport function changeGlobalNodesTarget(el: HTMLElement) {\r\n if (el === target) return\r\n\r\n target = el\r\n globalNodes.forEach((el) => {\r\n if (target && !el.contains(target)) {\r\n target.appendChild(el)\r\n }\r\n })\r\n}\r\n"],"names":["globalNodes","target","isClient","createGlobalNode","id","el","removeGlobalNode","changeGlobalNodesTarget"],"mappings":";AAEA,MAAMA,IAA6B,CAAA;AACnC,IAAIC,IAAmCC,IAAuB,SAAS,OAArB;AAE3C,SAASC,EAAiBC,GAAa;AACtC,QAAAC,IAAK,SAAS,cAAc,KAAK;AACvC,SAAID,MAAO,UACNC,EAAA,aAAa,MAAMD,CAAE,GAGtBH,MACFA,EAAO,YAAYI,CAAE,GACrBL,EAAY,KAAKK,CAAE,IAGdA;AACT;AAEO,SAASC,EAAiBD,GAAiB;AAChD,EAAAL,EAAY,OAAOA,EAAY,QAAQK,CAAE,GAAG,CAAC,GAC7CA,EAAG,OAAO;AACZ;AAEO,SAASE,EAAwBF,GAAiB;AACvD,EAAIA,MAAOJ,MAEFA,IAAAI,GACGL,EAAA,QAAQ,CAACK,MAAO;AAC1B,IAAIJ,KAAU,CAACI,EAAG,SAASJ,CAAM,KAC/BA,EAAO,YAAYI,CAAE;AAAA,EACvB,CACD;AACH;"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"icon.js","sources":["../../../../src/components/_util/vue/icon.ts"],"sourcesContent":["import {\n CircleCheck,\n CircleClose,\n CircleCloseFilled,\n Close,\n InfoFilled,\n Loading,\n SuccessFilled,\n WarningFilled,\n} from '@element-plus/icons-vue'\nimport { definePropType } from './props'\n\nimport type { Component } from 'vue'\n\nexport const iconPropType = definePropType<string | Component>([\n String,\n Object,\n Function,\n])\n\nexport const CloseComponents = {\n Close,\n}\n\nexport const TypeComponents = {\n Close,\n SuccessFilled,\n InfoFilled,\n WarningFilled,\n CircleCloseFilled,\n}\n\nexport const TypeComponentsMap = {\n success: SuccessFilled,\n warning: WarningFilled,\n error: CircleCloseFilled,\n info: InfoFilled,\n}\n\nexport const ValidateComponentsMap = {\n validating: Loading,\n success: CircleCheck,\n error: CircleClose,\n}\n"],"names":["iconPropType","definePropType","CloseComponents","Close","TypeComponents","SuccessFilled","InfoFilled","WarningFilled","CircleCloseFilled","TypeComponentsMap","ValidateComponentsMap","Loading","CircleCheck","CircleClose"],"mappings":";;AAcO,MAAMA,IAAeC,EAAmC;AAAA,EAC7D;AAAA,EACA;AAAA,EACA;AACF,CAAC,GAEYC,IAAkB;AAAA,EAAA,OAC7BC;AACF,GAEaC,IAAiB;AAAA,EAAA,OAC5BD;AAAAA,EAAA,eACAE;AAAAA,EAAA,YACAC;AAAAA,EAAA,eACAC;AAAAA,EAAA,mBACAC;AACF,GAEaC,IAAoB;AAAA,EAC/B,SAASJ;AAAAA,EACT,SAASE;AAAAA,EACT,OAAOC;AAAAA,EACP,MAAMF;AACR,GAEaI,IAAwB;AAAA,EACnC,YAAYC;AAAAA,EACZ,SAASC;AAAAA,EACT,OAAOC;AACT;"}
|
1
|
+
{"version":3,"file":"icon.js","sources":["../../../../src/components/_util/vue/icon.ts"],"sourcesContent":["import {\r\n CircleCheck,\r\n CircleClose,\r\n CircleCloseFilled,\r\n Close,\r\n InfoFilled,\r\n Loading,\r\n SuccessFilled,\r\n WarningFilled,\r\n} from '@element-plus/icons-vue'\r\nimport { definePropType } from './props'\r\n\r\nimport type { Component } from 'vue'\r\n\r\nexport const iconPropType = definePropType<string | Component>([\r\n String,\r\n Object,\r\n Function,\r\n])\r\n\r\nexport const CloseComponents = {\r\n Close,\r\n}\r\n\r\nexport const TypeComponents = {\r\n Close,\r\n SuccessFilled,\r\n InfoFilled,\r\n WarningFilled,\r\n CircleCloseFilled,\r\n}\r\n\r\nexport const TypeComponentsMap = {\r\n success: SuccessFilled,\r\n warning: WarningFilled,\r\n error: CircleCloseFilled,\r\n info: InfoFilled,\r\n}\r\n\r\nexport const ValidateComponentsMap = {\r\n validating: Loading,\r\n success: CircleCheck,\r\n error: CircleClose,\r\n}\r\n"],"names":["iconPropType","definePropType","CloseComponents","Close","TypeComponents","SuccessFilled","InfoFilled","WarningFilled","CircleCloseFilled","TypeComponentsMap","ValidateComponentsMap","Loading","CircleCheck","CircleClose"],"mappings":";;AAcO,MAAMA,IAAeC,EAAmC;AAAA,EAC7D;AAAA,EACA;AAAA,EACA;AACF,CAAC,GAEYC,IAAkB;AAAA,EAAA,OAC7BC;AACF,GAEaC,IAAiB;AAAA,EAAA,OAC5BD;AAAAA,EAAA,eACAE;AAAAA,EAAA,YACAC;AAAAA,EAAA,eACAC;AAAAA,EAAA,mBACAC;AACF,GAEaC,IAAoB;AAAA,EAC/B,SAASJ;AAAAA,EACT,SAASE;AAAAA,EACT,OAAOC;AAAAA,EACP,MAAMF;AACR,GAEaI,IAAwB;AAAA,EACnC,YAAYC;AAAAA,EACZ,SAASC;AAAAA,EACT,OAAOC;AACT;"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"install.js","sources":["../../../../src/components/_util/vue/install.ts"],"sourcesContent":["import { NOOP } from '../functions'\n\nimport type { App, Directive } from 'vue'\nimport type { SFCInstallWithContext, SFCWithInstall } from './typescript'\n\nexport const withInstall = <T, E extends Record<string, any>>(\n main: T,\n extra?: E\n) => {\n ;(main as SFCWithInstall<T>).install = (app): void => {\n for (const comp of [main, ...Object.values(extra ?? {})]) {\n app.component(comp.name, comp)\n }\n }\n\n if (extra) {\n for (const [key, comp] of Object.entries(extra)) {\n ;(main as any)[key] = comp\n }\n }\n return main as SFCWithInstall<T> & E\n}\n\nexport const withInstallFunction = <T>(fn: T, name: string) => {\n ;(fn as SFCWithInstall<T>).install = (app: App) => {\n ;(fn as SFCInstallWithContext<T>)._context = app._context\n app.config.globalProperties[name] = fn\n }\n\n return fn as SFCInstallWithContext<T>\n}\n\nexport const withInstallDirective = <T extends Directive>(\n directive: T,\n name: string\n) => {\n ;(directive as SFCWithInstall<T>).install = (app: App): void => {\n app.directive(name, directive)\n }\n\n return directive as SFCWithInstall<T>\n}\n\nexport const withNoopInstall = <T>(component: T) => {\n ;(component as SFCWithInstall<T>).install = NOOP\n\n return component as SFCWithInstall<T>\n}\n"],"names":["withInstall","main","extra","app","comp","key","withInstallFunction","fn","name","withInstallDirective","directive","withNoopInstall","component","NOOP"],"mappings":";AAKa,MAAAA,IAAc,CACzBC,GACAC,MACG;AAOH,MANED,EAA2B,UAAU,CAACE,MAAc;AACzC,eAAAC,KAAQ,CAACH,GAAM,GAAG,OAAO,OAAOC,KAAS,CAAE,CAAA,CAAC;AACjD,MAAAC,EAAA,UAAUC,EAAK,MAAMA,CAAI;AAAA,EAC/B,GAGEF;AACF,eAAW,CAACG,GAAKD,CAAI,KAAK,OAAO,QAAQF,CAAK;AAC1C,MAAAD,EAAaI,CAAG,IAAID;AAGnB,SAAAH;AACT,GAEaK,IAAsB,CAAIC,GAAOC,OAC1CD,EAAyB,UAAU,CAACJ,MAAa;AAC/C,EAAAI,EAAgC,WAAWJ,EAAI,UAC7CA,EAAA,OAAO,iBAAiBK,CAAI,IAAID;AAAA,GAG/BA,IAGIE,IAAuB,CAClCC,GACAF,OAEEE,EAAgC,UAAU,CAACP,MAAmB;AAC1D,EAAAA,EAAA,UAAUK,GAAME,CAAS;AAAA,GAGxBA,IAGIC,IAAkB,CAAIC,OAC/BA,EAAgC,UAAUC,GAErCD;"}
|
1
|
+
{"version":3,"file":"install.js","sources":["../../../../src/components/_util/vue/install.ts"],"sourcesContent":["import { NOOP } from '../functions'\r\n\r\nimport type { App, Directive } from 'vue'\r\nimport type { SFCInstallWithContext, SFCWithInstall } from './typescript'\r\n\r\nexport const withInstall = <T, E extends Record<string, any>>(\r\n main: T,\r\n extra?: E\r\n) => {\r\n ;(main as SFCWithInstall<T>).install = (app): void => {\r\n for (const comp of [main, ...Object.values(extra ?? {})]) {\r\n app.component(comp.name, comp)\r\n }\r\n }\r\n\r\n if (extra) {\r\n for (const [key, comp] of Object.entries(extra)) {\r\n ;(main as any)[key] = comp\r\n }\r\n }\r\n return main as SFCWithInstall<T> & E\r\n}\r\n\r\nexport const withInstallFunction = <T>(fn: T, name: string) => {\r\n ;(fn as SFCWithInstall<T>).install = (app: App) => {\r\n ;(fn as SFCInstallWithContext<T>)._context = app._context\r\n app.config.globalProperties[name] = fn\r\n }\r\n\r\n return fn as SFCInstallWithContext<T>\r\n}\r\n\r\nexport const withInstallDirective = <T extends Directive>(\r\n directive: T,\r\n name: string\r\n) => {\r\n ;(directive as SFCWithInstall<T>).install = (app: App): void => {\r\n app.directive(name, directive)\r\n }\r\n\r\n return directive as SFCWithInstall<T>\r\n}\r\n\r\nexport const withNoopInstall = <T>(component: T) => {\r\n ;(component as SFCWithInstall<T>).install = NOOP\r\n\r\n return component as SFCWithInstall<T>\r\n}\r\n"],"names":["withInstall","main","extra","app","comp","key","withInstallFunction","fn","name","withInstallDirective","directive","withNoopInstall","component","NOOP"],"mappings":";AAKa,MAAAA,IAAc,CACzBC,GACAC,MACG;AAOH,MANED,EAA2B,UAAU,CAACE,MAAc;AACzC,eAAAC,KAAQ,CAACH,GAAM,GAAG,OAAO,OAAOC,KAAS,CAAE,CAAA,CAAC;AACjD,MAAAC,EAAA,UAAUC,EAAK,MAAMA,CAAI;AAAA,EAC/B,GAGEF;AACF,eAAW,CAACG,GAAKD,CAAI,KAAK,OAAO,QAAQF,CAAK;AAC1C,MAAAD,EAAaI,CAAG,IAAID;AAGnB,SAAAH;AACT,GAEaK,IAAsB,CAAIC,GAAOC,OAC1CD,EAAyB,UAAU,CAACJ,MAAa;AAC/C,EAAAI,EAAgC,WAAWJ,EAAI,UAC7CA,EAAA,OAAO,iBAAiBK,CAAI,IAAID;AAAA,GAG/BA,IAGIE,IAAuB,CAClCC,GACAF,OAEEE,EAAgC,UAAU,CAACP,MAAmB;AAC1D,EAAAA,EAAA,UAAUK,GAAME,CAAS;AAAA,GAGxBA,IAGIC,IAAkB,CAAIC,OAC/BA,EAAgC,UAAUC,GAErCD;"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"runtime.js","sources":["../../../../../src/components/_util/vue/props/runtime.ts"],"sourcesContent":["import { warn } from 'vue'\nimport { fromPairs } from 'lodash-unified'\nimport { isObject } from '../../types'\nimport { hasOwn } from '../../objects'\n\nimport type { PropType } from 'vue'\nimport type {\n EpProp,\n EpPropConvert,\n EpPropFinalized,\n EpPropInput,\n EpPropMergeType,\n IfEpProp,\n IfNativePropType,\n NativePropType,\n} from './types'\n\nexport const epPropKey = '__epPropKey'\n\nexport const definePropType = <T>(val: any): PropType<T> => val\n\nexport const isEpProp = (val: unknown): val is EpProp<any, any, any> =>\n isObject(val) && !!(val as any)[epPropKey]\n\n/**\n * @description Build prop. It can better optimize prop types\n * @description 生成 prop,能更好地优化类型\n * @example\n // limited options\n // the type will be PropType<'light' | 'dark'>\n buildProp({\n type: String,\n values: ['light', 'dark'],\n } as const)\n * @example\n // limited options and other types\n // the type will be PropType<'small' | 'large' | number>\n buildProp({\n type: [String, Number],\n values: ['small', 'large'],\n validator: (val: unknown): val is number => typeof val === 'number',\n } as const)\n @link see more: https://github.com/element-plus/element-plus/pull/3341\n */\nexport const buildProp = <\n Type = never,\n Value = never,\n Validator = never,\n Default extends EpPropMergeType<Type, Value, Validator> = never,\n Required extends boolean = false\n>(\n prop: EpPropInput<Type, Value, Validator, Default, Required>,\n key?: string\n): EpPropFinalized<Type, Value, Validator, Default, Required> => {\n // filter native prop type and nested prop, e.g `null`, `undefined` (from `buildProps`)\n if (!isObject(prop) || isEpProp(prop)) return prop as any\n\n const { values, required, default: defaultValue, type, validator } = prop\n\n const _validator =\n values || validator\n ? (val: unknown) => {\n let valid = false\n let allowedValues: unknown[] = []\n\n if (values) {\n allowedValues = Array.from(values)\n if (hasOwn(prop, 'default')) {\n allowedValues.push(defaultValue)\n }\n valid ||= allowedValues.includes(val)\n }\n if (validator) valid ||= validator(val)\n\n if (!valid && allowedValues.length > 0) {\n const allowValuesText = [...new Set(allowedValues)]\n .map((value) => JSON.stringify(value))\n .join(', ')\n warn(\n `Invalid prop: validation failed${\n key ? ` for prop \"${key}\"` : ''\n }. Expected one of [${allowValuesText}], got value ${JSON.stringify(\n val\n )}.`\n )\n }\n return valid\n }\n : undefined\n\n const epProp: any = {\n type,\n required: !!required,\n validator: _validator,\n [epPropKey]: true,\n }\n if (hasOwn(prop, 'default')) epProp.default = defaultValue\n return epProp\n}\n\nexport const buildProps = <\n Props extends Record<\n string,\n | { [epPropKey]: true }\n | NativePropType\n | EpPropInput<any, any, any, any, any>\n >\n>(\n props: Props\n): {\n [K in keyof Props]: IfEpProp<\n Props[K],\n Props[K],\n IfNativePropType<Props[K], Props[K], EpPropConvert<Props[K]>>\n >\n} =>\n fromPairs(\n Object.entries(props).map(([key, option]) => [\n key,\n buildProp(option as any, key),\n ])\n ) as any\n"],"names":["epPropKey","definePropType","val","isEpProp","isObject","buildProp","prop","key","values","required","defaultValue","type","validator","epProp","valid","allowedValues","hasOwn","allowValuesText","value","warn","buildProps","props","fromPairs","option"],"mappings":";;;AAiBO,MAAMA,IAAY,eAEZC,IAAiB,CAAIC,MAA0BA,GAE/CC,IAAW,CAACD,MACvBE,EAASF,CAAG,KAAK,CAAC,CAAEA,EAAYF,CAAS,GAsB9BK,IAAY,CAOvBC,GACAC,MAC+D;AAE/D,MAAI,CAACH,EAASE,CAAI,KAAKH,EAASG,CAAI,EAAU,QAAAA;AAE9C,QAAM,EAAE,QAAAE,GAAQ,UAAAC,GAAU,SAASC,GAAc,MAAAC,GAAM,WAAAC,EAAc,IAAAN,GAiC/DO,IAAc;AAAA,IAClB,MAAAF;AAAA,IACA,UAAU,CAAC,CAACF;AAAA,IACZ,WAjCAD,KAAUI,IACN,CAACV,MAAiB;AAChB,UAAIY,IAAQ,IACRC,IAA2B,CAAA;AAW/B,UATIP,MACcO,IAAA,MAAM,KAAKP,CAAM,GAC7BQ,EAAOV,GAAM,SAAS,KACxBS,EAAc,KAAKL,CAAY,GAEvBI,UAAAC,EAAc,SAASb,CAAG,KAElCU,MAAqBE,UAAAF,EAAUV,CAAG,KAElC,CAACY,KAASC,EAAc,SAAS,GAAG;AACtC,cAAME,IAAkB,CAAC,GAAG,IAAI,IAAIF,CAAa,CAAC,EAC/C,IAAI,CAACG,MAAU,KAAK,UAAUA,CAAK,CAAC,EACpC,KAAK,IAAI;AACZ,QAAAC;AAAA,UACE,kCACEZ,IAAM,cAAcA,CAAG,MAAM,EAC/B,sBAAsBU,CAAe,gBAAgB,KAAK;AAAA,YACxDf;AAAA,UACD,CAAA;AAAA,QAAA;AAAA,MAEL;AACO,aAAAY;AAAA,IAET,IAAA;AAAA,IAMJ,CAACd,CAAS,GAAG;AAAA,EAAA;AAEf,SAAIgB,EAAOV,GAAM,SAAS,QAAU,UAAUI,IACvCG;AACT,GAEaO,IAAa,CAQxBC,MAQAC;AAAA,EACE,OAAO,QAAQD,CAAK,EAAE,IAAI,CAAC,CAACd,GAAKgB,CAAM,MAAM;AAAA,IAC3ChB;AAAA,IACAF,EAAUkB,GAAehB,CAAG;AAAA,EAAA,CAC7B;AACH;"}
|
1
|
+
{"version":3,"file":"runtime.js","sources":["../../../../../src/components/_util/vue/props/runtime.ts"],"sourcesContent":["import { warn } from 'vue'\r\nimport { fromPairs } from 'lodash-unified'\r\nimport { isObject } from '../../types'\r\nimport { hasOwn } from '../../objects'\r\n\r\nimport type { PropType } from 'vue'\r\nimport type {\r\n EpProp,\r\n EpPropConvert,\r\n EpPropFinalized,\r\n EpPropInput,\r\n EpPropMergeType,\r\n IfEpProp,\r\n IfNativePropType,\r\n NativePropType,\r\n} from './types'\r\n\r\nexport const epPropKey = '__epPropKey'\r\n\r\nexport const definePropType = <T>(val: any): PropType<T> => val\r\n\r\nexport const isEpProp = (val: unknown): val is EpProp<any, any, any> =>\r\n isObject(val) && !!(val as any)[epPropKey]\r\n\r\n/**\r\n * @description Build prop. It can better optimize prop types\r\n * @description 生成 prop,能更好地优化类型\r\n * @example\r\n // limited options\r\n // the type will be PropType<'light' | 'dark'>\r\n buildProp({\r\n type: String,\r\n values: ['light', 'dark'],\r\n } as const)\r\n * @example\r\n // limited options and other types\r\n // the type will be PropType<'small' | 'large' | number>\r\n buildProp({\r\n type: [String, Number],\r\n values: ['small', 'large'],\r\n validator: (val: unknown): val is number => typeof val === 'number',\r\n } as const)\r\n @link see more: https://github.com/element-plus/element-plus/pull/3341\r\n */\r\nexport const buildProp = <\r\n Type = never,\r\n Value = never,\r\n Validator = never,\r\n Default extends EpPropMergeType<Type, Value, Validator> = never,\r\n Required extends boolean = false\r\n>(\r\n prop: EpPropInput<Type, Value, Validator, Default, Required>,\r\n key?: string\r\n): EpPropFinalized<Type, Value, Validator, Default, Required> => {\r\n // filter native prop type and nested prop, e.g `null`, `undefined` (from `buildProps`)\r\n if (!isObject(prop) || isEpProp(prop)) return prop as any\r\n\r\n const { values, required, default: defaultValue, type, validator } = prop\r\n\r\n const _validator =\r\n values || validator\r\n ? (val: unknown) => {\r\n let valid = false\r\n let allowedValues: unknown[] = []\r\n\r\n if (values) {\r\n allowedValues = Array.from(values)\r\n if (hasOwn(prop, 'default')) {\r\n allowedValues.push(defaultValue)\r\n }\r\n valid ||= allowedValues.includes(val)\r\n }\r\n if (validator) valid ||= validator(val)\r\n\r\n if (!valid && allowedValues.length > 0) {\r\n const allowValuesText = [...new Set(allowedValues)]\r\n .map((value) => JSON.stringify(value))\r\n .join(', ')\r\n warn(\r\n `Invalid prop: validation failed${\r\n key ? ` for prop \"${key}\"` : ''\r\n }. Expected one of [${allowValuesText}], got value ${JSON.stringify(\r\n val\r\n )}.`\r\n )\r\n }\r\n return valid\r\n }\r\n : undefined\r\n\r\n const epProp: any = {\r\n type,\r\n required: !!required,\r\n validator: _validator,\r\n [epPropKey]: true,\r\n }\r\n if (hasOwn(prop, 'default')) epProp.default = defaultValue\r\n return epProp\r\n}\r\n\r\nexport const buildProps = <\r\n Props extends Record<\r\n string,\r\n | { [epPropKey]: true }\r\n | NativePropType\r\n | EpPropInput<any, any, any, any, any>\r\n >\r\n>(\r\n props: Props\r\n): {\r\n [K in keyof Props]: IfEpProp<\r\n Props[K],\r\n Props[K],\r\n IfNativePropType<Props[K], Props[K], EpPropConvert<Props[K]>>\r\n >\r\n} =>\r\n fromPairs(\r\n Object.entries(props).map(([key, option]) => [\r\n key,\r\n buildProp(option as any, key),\r\n ])\r\n ) as any\r\n"],"names":["epPropKey","definePropType","val","isEpProp","isObject","buildProp","prop","key","values","required","defaultValue","type","validator","epProp","valid","allowedValues","hasOwn","allowValuesText","value","warn","buildProps","props","fromPairs","option"],"mappings":";;;AAiBO,MAAMA,IAAY,eAEZC,IAAiB,CAAIC,MAA0BA,GAE/CC,IAAW,CAACD,MACvBE,EAASF,CAAG,KAAK,CAAC,CAAEA,EAAYF,CAAS,GAsB9BK,IAAY,CAOvBC,GACAC,MAC+D;AAE/D,MAAI,CAACH,EAASE,CAAI,KAAKH,EAASG,CAAI,EAAU,QAAAA;AAE9C,QAAM,EAAE,QAAAE,GAAQ,UAAAC,GAAU,SAASC,GAAc,MAAAC,GAAM,WAAAC,EAAc,IAAAN,GAiC/DO,IAAc;AAAA,IAClB,MAAAF;AAAA,IACA,UAAU,CAAC,CAACF;AAAA,IACZ,WAjCAD,KAAUI,IACN,CAACV,MAAiB;AAChB,UAAIY,IAAQ,IACRC,IAA2B,CAAA;AAW/B,UATIP,MACcO,IAAA,MAAM,KAAKP,CAAM,GAC7BQ,EAAOV,GAAM,SAAS,KACxBS,EAAc,KAAKL,CAAY,GAEvBI,UAAAC,EAAc,SAASb,CAAG,KAElCU,MAAqBE,UAAAF,EAAUV,CAAG,KAElC,CAACY,KAASC,EAAc,SAAS,GAAG;AACtC,cAAME,IAAkB,CAAC,GAAG,IAAI,IAAIF,CAAa,CAAC,EAC/C,IAAI,CAACG,MAAU,KAAK,UAAUA,CAAK,CAAC,EACpC,KAAK,IAAI;AACZ,QAAAC;AAAA,UACE,kCACEZ,IAAM,cAAcA,CAAG,MAAM,EAC/B,sBAAsBU,CAAe,gBAAgB,KAAK;AAAA,YACxDf;AAAA,UACD,CAAA;AAAA,QAAA;AAAA,MAEL;AACO,aAAAY;AAAA,IAET,IAAA;AAAA,IAMJ,CAACd,CAAS,GAAG;AAAA,EAAA;AAEf,SAAIgB,EAAOV,GAAM,SAAS,QAAU,UAAUI,IACvCG;AACT,GAEaO,IAAa,CAQxBC,MAQAC;AAAA,EACE,OAAO,QAAQD,CAAK,EAAE,IAAI,CAAC,CAACd,GAAKgB,CAAM,MAAM;AAAA,IAC3ChB;AAAA,IACAF,EAAUkB,GAAehB,CAAG;AAAA,EAAA,CAC7B;AACH;"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"refs.js","sources":["../../../../src/components/_util/vue/refs.ts"],"sourcesContent":["import { isFunction } from '../types'\n\nimport type { ComponentPublicInstance, Ref } from 'vue'\n\nexport type RefSetter = (\n el: Element | ComponentPublicInstance | undefined\n) => void\n\nexport const composeRefs = (\n ...refs: (Ref<HTMLElement | undefined> | RefSetter)[]\n) => {\n return (el: Element | ComponentPublicInstance | null) => {\n refs.forEach((ref) => {\n if (isFunction(ref)) {\n ref(el as Element | ComponentPublicInstance)\n } else {\n ref.value = el as HTMLElement | undefined\n }\n })\n }\n}\n"],"names":["composeRefs","refs","el","ref","isFunction"],"mappings":";;;AAQa,MAAAA,IAAc,IACtBC,MAEI,CAACC,MAAiD;AAClD,EAAAD,EAAA,QAAQ,CAACE,MAAQ;AAChB,IAAAC,EAAWD,CAAG,IAChBA,EAAID,CAAuC,IAE3CC,EAAI,QAAQD;AAAA,EACd,CACD;AAAA;"}
|
1
|
+
{"version":3,"file":"refs.js","sources":["../../../../src/components/_util/vue/refs.ts"],"sourcesContent":["import { isFunction } from '../types'\r\n\r\nimport type { ComponentPublicInstance, Ref } from 'vue'\r\n\r\nexport type RefSetter = (\r\n el: Element | ComponentPublicInstance | undefined\r\n) => void\r\n\r\nexport const composeRefs = (\r\n ...refs: (Ref<HTMLElement | undefined> | RefSetter)[]\r\n) => {\r\n return (el: Element | ComponentPublicInstance | null) => {\r\n refs.forEach((ref) => {\r\n if (isFunction(ref)) {\r\n ref(el as Element | ComponentPublicInstance)\r\n } else {\r\n ref.value = el as HTMLElement | undefined\r\n }\r\n })\r\n }\r\n}\r\n"],"names":["composeRefs","refs","el","ref","isFunction"],"mappings":";;;AAQa,MAAAA,IAAc,IACtBC,MAEI,CAACC,MAAiD;AAClD,EAAAD,EAAA,QAAQ,CAACE,MAAQ;AAChB,IAAAC,EAAWD,CAAG,IAChBA,EAAID,CAAuC,IAE3CC,EAAI,QAAQD;AAAA,EACd,CACD;AAAA;"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"size.js","sources":["../../../../src/components/_util/vue/size.ts"],"sourcesContent":["import { componentSizeMap } from 'element-plus'\n\nimport type { ComponentSize } from 'element-plus'\n\nexport const getComponentSize = (size?: ComponentSize) => {\n return componentSizeMap[size || 'default']\n}\n"],"names":["getComponentSize","size","componentSizeMap"],"mappings":";AAIa,MAAAA,IAAmB,CAACC,MACxBC,EAAiBD,KAAQ,SAAS;"}
|
1
|
+
{"version":3,"file":"size.js","sources":["../../../../src/components/_util/vue/size.ts"],"sourcesContent":["import { componentSizeMap } from 'element-plus'\r\n\r\nimport type { ComponentSize } from 'element-plus'\r\n\r\nexport const getComponentSize = (size?: ComponentSize) => {\r\n return componentSizeMap[size || 'default']\r\n}\r\n"],"names":["getComponentSize","size","componentSizeMap"],"mappings":";AAIa,MAAAA,IAAmB,CAACC,MACxBC,EAAiBD,KAAQ,SAAS;"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"validator.js","sources":["../../../../src/components/_util/vue/validator.ts"],"sourcesContent":["import { componentSizes, datePickTypes } from 'element-plus'\nimport type { ComponentSize, DatePickType } from 'element-plus'\n\nexport const isValidComponentSize = (val: string): val is ComponentSize | '' =>\n ['', ...componentSizes].includes(val)\n\nexport const isValidDatePickType = (val: string): val is DatePickType =>\n ([...datePickTypes] as string[]).includes(val)\n"],"names":["isValidComponentSize","val","componentSizes","isValidDatePickType","datePickTypes"],"mappings":";AAGa,MAAAA,IAAuB,CAACC,MACnC,CAAC,IAAI,GAAGC,CAAc,EAAE,SAASD,CAAG,GAEzBE,IAAsB,CAACF,MACjC,CAAC,GAAGG,CAAa,EAAe,SAASH,CAAG;"}
|
1
|
+
{"version":3,"file":"validator.js","sources":["../../../../src/components/_util/vue/validator.ts"],"sourcesContent":["import { componentSizes, datePickTypes } from 'element-plus'\r\nimport type { ComponentSize, DatePickType } from 'element-plus'\r\n\r\nexport const isValidComponentSize = (val: string): val is ComponentSize | '' =>\r\n ['', ...componentSizes].includes(val)\r\n\r\nexport const isValidDatePickType = (val: string): val is DatePickType =>\r\n ([...datePickTypes] as string[]).includes(val)\r\n"],"names":["isValidComponentSize","val","componentSizes","isValidDatePickType","datePickTypes"],"mappings":";AAGa,MAAAA,IAAuB,CAACC,MACnC,CAAC,IAAI,GAAGC,CAAc,EAAE,SAASD,CAAG,GAEzBE,IAAsB,CAACF,MACjC,CAAC,GAAGG,CAAa,EAAe,SAASH,CAAG;"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"vnode.js","sources":["../../../../src/components/_util/vue/vnode.ts"],"sourcesContent":["import {\n Comment,\n Fragment,\n Text,\n createBlock,\n createCommentVNode,\n isVNode,\n openBlock,\n} from 'vue'\nimport { camelize } from '../strings'\nimport { isArray } from '../types'\nimport { hasOwn } from '../objects'\nimport { debugWarn } from '../error'\nimport type {\n VNode,\n VNodeArrayChildren,\n VNodeChild,\n VNodeNormalizedChildren,\n} from 'vue'\n\nconst SCOPE = 'utils/vue/vnode'\n\nexport enum PatchFlags {\n TEXT = 1,\n CLASS = 2,\n STYLE = 4,\n PROPS = 8,\n FULL_PROPS = 16,\n HYDRATE_EVENTS = 32,\n STABLE_FRAGMENT = 64,\n KEYED_FRAGMENT = 128,\n UNKEYED_FRAGMENT = 256,\n NEED_PATCH = 512,\n DYNAMIC_SLOTS = 1024,\n HOISTED = -1,\n BAIL = -2,\n}\n\nexport type VNodeChildAtom = Exclude<VNodeChild, Array<any>>\nexport type RawSlots = Exclude<\n VNodeNormalizedChildren,\n Array<any> | null | string\n>\n\nexport function isFragment(node: VNode): boolean\nexport function isFragment(node: unknown): node is VNode\nexport function isFragment(node: unknown): node is VNode {\n return isVNode(node) && node.type === Fragment\n}\n\nexport function isText(node: VNode): boolean\nexport function isText(node: unknown): node is VNode\nexport function isText(node: unknown): node is VNode {\n return isVNode(node) && node.type === Text\n}\n\nexport function isComment(node: VNode): boolean\nexport function isComment(node: unknown): node is VNode\nexport function isComment(node: unknown): node is VNode {\n return isVNode(node) && node.type === Comment\n}\n\nconst TEMPLATE = 'template'\nexport function isTemplate(node: VNode): boolean\nexport function isTemplate(node: unknown): node is VNode\nexport function isTemplate(node: unknown): node is VNode {\n return isVNode(node) && node.type === TEMPLATE\n}\n\n/**\n * determine if the element is a valid element type rather than fragments and comment e.g. <template> v-if\n * @param node {VNode} node to be tested\n */\nexport function isValidElementNode(node: VNode): boolean\nexport function isValidElementNode(node: unknown): node is VNode\nexport function isValidElementNode(node: unknown): node is VNode {\n return isVNode(node) && !isFragment(node) && !isComment(node)\n}\n\n/**\n * get a valid child node (not fragment nor comment)\n * @param node {VNode} node to be searched\n * @param depth {number} depth to be searched\n */\nfunction getChildren(\n node: VNodeNormalizedChildren | VNodeChild,\n depth: number\n): VNodeNormalizedChildren | VNodeChild {\n if (isComment(node)) return\n if (isFragment(node) || isTemplate(node)) {\n return depth > 0 ? getFirstValidNode(node.children, depth - 1) : undefined\n }\n return node\n}\n\nexport const getFirstValidNode = (\n nodes: VNodeNormalizedChildren,\n maxDepth = 3\n) => {\n if (Array.isArray(nodes)) {\n return getChildren(nodes[0], maxDepth)\n } else {\n return getChildren(nodes, maxDepth)\n }\n}\n\nexport function renderIf(\n condition: boolean,\n ...args: Parameters<typeof createBlock>\n) {\n return condition ? renderBlock(...args) : createCommentVNode('v-if', true)\n}\n\nexport function renderBlock(...args: Parameters<typeof createBlock>) {\n return openBlock(), createBlock(...args)\n}\n\nexport const getNormalizedProps = (node: VNode) => {\n if (!isVNode(node)) {\n debugWarn(SCOPE, '[getNormalizedProps] must be a VNode')\n return {}\n }\n\n const raw = node.props || {}\n const type = (isVNode(node.type) ? node.type.props : undefined) || {}\n const props: Record<string, any> = {}\n\n Object.keys(type).forEach((key) => {\n if (hasOwn(type[key], 'default')) {\n props[key] = type[key].default\n }\n })\n\n Object.keys(raw).forEach((key) => {\n props[camelize(key)] = raw[key]\n })\n\n return props\n}\n\nexport const ensureOnlyChild = (children: VNodeArrayChildren | undefined) => {\n if (!isArray(children) || children.length > 1) {\n throw new Error('expect to receive a single Vue element child')\n }\n return children[0]\n}\n\nexport type FlattenVNodes = Array<VNodeChildAtom | RawSlots>\n\nexport const flattedChildren = (\n children: FlattenVNodes | VNode | VNodeNormalizedChildren\n): FlattenVNodes => {\n const vNodes = isArray(children) ? children : [children]\n const result: FlattenVNodes = []\n\n vNodes.forEach((child) => {\n if (isArray(child)) {\n result.push(...flattedChildren(child))\n } else if (isVNode(child) && isArray(child.children)) {\n result.push(...flattedChildren(child.children))\n } else {\n result.push(child)\n if (isVNode(child) && child.component?.subTree) {\n result.push(...flattedChildren(child.component.subTree))\n }\n }\n })\n return result\n}\n"],"names":["SCOPE","PatchFlags","isFragment","node","isVNode","Fragment","isText","Text","isComment","Comment","TEMPLATE","isTemplate","isValidElementNode","getChildren","depth","getFirstValidNode","nodes","maxDepth","renderIf","condition","args","renderBlock","createCommentVNode","openBlock","createBlock","getNormalizedProps","debugWarn","raw","type","props","key","hasOwn","camelize","ensureOnlyChild","children","isArray","flattedChildren","vNodes","result","child","_a"],"mappings":";;;;AAoBA,MAAMA,IAAQ;AAEF,IAAAC,sBAAAA,OACVA,EAAAA,EAAA,OAAO,CAAP,IAAA,QACAA,EAAAA,EAAA,QAAQ,CAAR,IAAA,SACAA,EAAAA,EAAA,QAAQ,CAAR,IAAA,SACAA,EAAAA,EAAA,QAAQ,CAAR,IAAA,SACAA,EAAAA,EAAA,aAAa,EAAb,IAAA,cACAA,EAAAA,EAAA,iBAAiB,EAAjB,IAAA,kBACAA,EAAAA,EAAA,kBAAkB,EAAlB,IAAA,mBACAA,EAAAA,EAAA,iBAAiB,GAAjB,IAAA,kBACAA,EAAAA,EAAA,mBAAmB,GAAnB,IAAA,oBACAA,EAAAA,EAAA,aAAa,GAAb,IAAA,cACAA,EAAAA,EAAA,gBAAgB,IAAhB,IAAA,iBACAA,EAAAA,EAAA,UAAU,EAAV,IAAA,WACAA,EAAAA,EAAA,OAAO,EAAP,IAAA,QAbUA,IAAAA,KAAA,CAAA,CAAA;AAwBL,SAASC,EAAWC,GAA8B;AACvD,SAAOC,EAAQD,CAAI,KAAKA,EAAK,SAASE;AACxC;AAIO,SAASC,EAAOH,GAA8B;AACnD,SAAOC,EAAQD,CAAI,KAAKA,EAAK,SAASI;AACxC;AAIO,SAASC,EAAUL,GAA8B;AACtD,SAAOC,EAAQD,CAAI,KAAKA,EAAK,SAASM;AACxC;AAEA,MAAMC,IAAW;AAGV,SAASC,EAAWR,GAA8B;AACvD,SAAOC,EAAQD,CAAI,KAAKA,EAAK,SAASO;AACxC;AAQO,SAASE,EAAmBT,GAA8B;AACxD,SAAAC,EAAQD,CAAI,KAAK,CAACD,EAAWC,CAAI,KAAK,CAACK,EAAUL,CAAI;AAC9D;AAOA,SAASU,EACPV,GACAW,GACsC;AAClC,MAAA,CAAAN,EAAUL,CAAI;AAClB,WAAID,EAAWC,CAAI,KAAKQ,EAAWR,CAAI,IAC9BW,IA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pB,IAAAJ,EAAQI,CAAK,IACfD,EAAO,KAAK,GAAGF,EAAgBG,CAAK,CAAC,IAC5BnC,EAAQmC,CAAK,KAAKJ,EAAQI,EAAM,QAAQ,IACjDD,EAAO,KAAK,GAAGF,EAAgBG,EAAM,QAAQ,CAAC,KAE9CD,EAAO,KAAKC,CAAK,GACbnC,EAAQmC,CAAK,OAAKC,IAAAD,EAAM,cAAN,QAAAC,EAAiB,YACrCF,EAAO,KAAK,GAAGF,EAAgBG,EAAM,UAAU,OAAO,CAAC;AAAA,EAE3D,CACD,GACMD;AACT;"}
|
1
|
+
{"version":3,"file":"vnode.js","sources":["../../../../src/components/_util/vue/vnode.ts"],"sourcesContent":["import {\r\n Comment,\r\n Fragment,\r\n Text,\r\n createBlock,\r\n createCommentVNode,\r\n isVNode,\r\n openBlock,\r\n} from 'vue'\r\nimport { camelize } from '../strings'\r\nimport { isArray } from '../types'\r\nimport { hasOwn } from '../objects'\r\nimport { debugWarn } from '../error'\r\nimport type {\r\n VNode,\r\n VNodeArrayChildren,\r\n VNodeChild,\r\n VNodeNormalizedChildren,\r\n} from 'vue'\r\n\r\nconst SCOPE = 'utils/vue/vnode'\r\n\r\nexport enum PatchFlags {\r\n TEXT = 1,\r\n CLASS = 2,\r\n STYLE = 4,\r\n PROPS = 8,\r\n FULL_PROPS = 16,\r\n HYDRATE_EVENTS = 32,\r\n STABLE_FRAGMENT = 64,\r\n KEYED_FRAGMENT = 128,\r\n UNKEYED_FRAGMENT = 256,\r\n NEED_PATCH = 512,\r\n DYNAMIC_SLOTS = 1024,\r\n HOISTED = -1,\r\n BAIL = -2,\r\n}\r\n\r\nexport type VNodeChildAtom = Exclude<VNodeChild, Array<any>>\r\nexport type RawSlots = Exclude<\r\n VNodeNormalizedChildren,\r\n Array<any> | null | string\r\n>\r\n\r\nexport function isFragment(node: VNode): boolean\r\nexport function isFragment(node: unknown): node is VNode\r\nexport function isFragment(node: unknown): node is VNode {\r\n return isVNode(node) && node.type === Fragment\r\n}\r\n\r\nexport function isText(node: VNode): boolean\r\nexport function isText(node: unknown): node is VNode\r\nexport function isText(node: unknown): node is VNode {\r\n return isVNode(node) && node.type === Text\r\n}\r\n\r\nexport function isComment(node: VNode): boolean\r\nexport function isComment(node: unknown): node is VNode\r\nexport function isComment(node: unknown): node is VNode {\r\n return isVNode(node) && node.type === Comment\r\n}\r\n\r\nconst TEMPLATE = 'template'\r\nexport function isTemplate(node: VNode): boolean\r\nexport function isTemplate(node: unknown): node is VNode\r\nexport function isTemplate(node: unknown): node is VNode {\r\n return isVNode(node) && node.type === TEMPLATE\r\n}\r\n\r\n/**\r\n * determine if the element is a valid element type rather than fragments and comment e.g. <template> v-if\r\n * @param node {VNode} node to be tested\r\n */\r\nexport function isValidElementNode(node: VNode): boolean\r\nexport function isValidElementNode(node: unknown): node is VNode\r\nexport function isValidElementNode(node: unknown): node is VNode {\r\n return isVNode(node) && !isFragment(node) && !isComment(node)\r\n}\r\n\r\n/**\r\n * get a valid child node (not fragment nor comment)\r\n * @param node {VNode} node to be searched\r\n * @param depth {number} depth to be searched\r\n */\r\nfunction getChildren(\r\n node: VNodeNormalizedChildren | VNodeChild,\r\n depth: number\r\n): VNodeNormalizedChildren | VNodeChild {\r\n if (isComment(node)) return\r\n if (isFragment(node) || isTemplate(node)) {\r\n return depth > 0 ? getFirstValidNode(node.children, depth - 1) : undefined\r\n }\r\n return node\r\n}\r\n\r\nexport const getFirstValidNode = (\r\n nodes: VNodeNormalizedChildren,\r\n maxDepth = 3\r\n) => {\r\n if (Array.isArray(nodes)) {\r\n return getChildren(nodes[0], maxDepth)\r\n } else {\r\n return getChildren(nodes, maxDepth)\r\n }\r\n}\r\n\r\nexport function renderIf(\r\n condition: boolean,\r\n ...args: Parameters<typeof createBlock>\r\n) {\r\n return condition ? renderBlock(...args) : createCommentVNode('v-if', true)\r\n}\r\n\r\nexport function renderBlock(...args: Parameters<typeof createBlock>) {\r\n return openBlock(), createBlock(...args)\r\n}\r\n\r\nexport const getNormalizedProps = (node: VNode) => {\r\n if (!isVNode(node)) {\r\n debugWarn(SCOPE, '[getNormalizedProps] must be a VNode')\r\n return {}\r\n }\r\n\r\n const raw = node.props || {}\r\n const type = (isVNode(node.type) ? node.type.props : undefined) || {}\r\n const props: Record<string, any> = {}\r\n\r\n Object.keys(type).forEach((key) => {\r\n if (hasOwn(type[key], 'default')) {\r\n props[key] = type[key].default\r\n }\r\n })\r\n\r\n Object.keys(raw).forEach((key) => {\r\n props[camelize(key)] = raw[key]\r\n })\r\n\r\n return props\r\n}\r\n\r\nexport const ensureOnlyChild = (children: VNodeArrayChildren | undefined) => {\r\n if (!isArray(children) || children.length > 1) {\r\n throw new Error('expect to receive a single Vue element child')\r\n }\r\n return children[0]\r\n}\r\n\r\nexport type FlattenVNodes = Array<VNodeChildAtom | RawSlots>\r\n\r\nexport const flattedChildren = (\r\n children: FlattenVNodes | VNode | VNodeNormalizedChildren\r\n): FlattenVNodes => {\r\n const vNodes = isArray(children) ? children : [children]\r\n const result: FlattenVNodes = []\r\n\r\n vNodes.forEach((child) => {\r\n if (isArray(child)) {\r\n result.push(...flattedChildren(child))\r\n } else if (isVNode(child) && isArray(child.children)) {\r\n result.push(...flattedChildren(child.children))\r\n } else {\r\n result.push(child)\r\n if (isVNode(child) && child.component?.subTree) {\r\n result.push(...flattedChildren(child.component.subTree))\r\n }\r\n }\r\n })\r\n return result\r\n}\r\n"],"names":["SCOPE","PatchFlags","isFragment","node","isVNode","Fragment","isText","Text","isComment","Comment","TEMPLATE","isTemplate","isValidElementNode","getChildren","depth","getFirstValidNode","nodes","maxDepth","renderIf","condition","args","renderBlock","createCommentVNode","openBlock","createBlock","getNormalizedProps","debugWarn","raw","type","props","key","hasOwn","camelize","ensureOnlyChild","children","isArray","flattedChildren","vNodes","result","child","_a"],"mappings":";;;;AAoBA,MAAMA,IAAQ;AAEF,IAAAC,sBAAAA,OACVA,EAAAA,EAAA,OAAO,CAAP,IAAA,QACAA,EAAAA,EAAA,QAAQ,CAA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AO,KAAKC,CAAK,GACbnC,EAAQmC,CAAK,OAAKC,IAAAD,EAAM,cAAN,QAAAC,EAAiB,YACrCF,EAAO,KAAK,GAAGF,EAAgBG,EAAM,UAAU,OAAO,CAAC;AAAA,EAE3D,CACD,GACMD;AACT;"}
|
@@ -1,2 +1,2 @@
|
|
1
|
-
declare const _default: "0.1.
|
1
|
+
declare const _default: "0.1.23";
|
2
2
|
export default _default;
|
package/dist/version/version.js
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"version.js","sources":["../../src/version/version.ts"],"sourcesContent":["export default '0.1.
|
1
|
+
{"version":3,"file":"version.js","sources":["../../src/version/version.ts"],"sourcesContent":["export default '0.1.23';"],"names":["version"],"mappings":"AAAA,MAAAA,IAAe;"}
|