orion-design 0.1.35 → 0.1.37

Sign up to get free protection for your applications and to get access to all the features.
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).
@@ -1 +1 @@
1
- {"version":3,"file":"use-throne-context.js","sources":["../../../src/Throne/hooks/use-throne-context.ts"],"sourcesContent":["import { computed, getCurrentInstance, inject, provide, ref, unref } from 'vue'\n\nimport type { InjectionKey } from 'vue'\n\nexport const throneContextKey: InjectionKey<Ref<Record<string, any> | undefined>> = Symbol('throneContext')\n\nimport type { App, Ref } from 'vue'\nimport type { ThroneContextProviderContext } from '../../components/Throne/ThroneContextProvider'\n\n\nexport function useThroneContext(): Ref<Record<string, any> | undefined> | undefined {\n const context = inject(throneContextKey, undefined)\n return context\n}\n\nexport const provideThroneContext = (props: ThroneContextProviderContext) => {\n const context = computed(() => {\n return props.context || undefined\n })\n\n provide(throneContextKey, context)\n\n return context\n}\n"],"names":["throneContextKey","useThroneContext","inject","provideThroneContext","props","context","computed","provide"],"mappings":";AAIa,MAAAA,IAAuE,OAAO,eAAe;AAMnG,SAASC,IAAqE;AAE5E,SADSC,EAAOF,GAAkB,MAAS;AAEpD;AAEa,MAAAG,IAAuB,CAACC,MAAwC;AACrE,QAAAC,IAAUC,EAAS,MAChBF,EAAM,WAAW,MACzB;AAED,SAAAG,EAAQP,GAAkBK,CAAO,GAE1BA;AACT;"}
1
+ {"version":3,"file":"use-throne-context.js","sources":["../../../src/Throne/hooks/use-throne-context.ts"],"sourcesContent":["import { computed, getCurrentInstance, inject, provide, ref, unref } from 'vue'\r\n\r\nimport type { InjectionKey } from 'vue'\r\n\r\nexport const throneContextKey: InjectionKey<Ref<Record<string, any> | undefined>> = Symbol('throneContext')\r\n\r\nimport type { App, Ref } from 'vue'\r\nimport type { ThroneContextProviderContext } from '../../components/Throne/ThroneContextProvider'\r\n\r\n\r\nexport function useThroneContext(): Ref<Record<string, any> | undefined> | undefined {\r\n const context = inject(throneContextKey, undefined)\r\n return context\r\n}\r\n\r\nexport const provideThroneContext = (props: ThroneContextProviderContext) => {\r\n const context = computed(() => {\r\n return props.context || undefined\r\n })\r\n\r\n provide(throneContextKey, context)\r\n\r\n return context\r\n}\r\n"],"names":["throneContextKey","useThroneContext","inject","provideThroneContext","props","context","computed","provide"],"mappings":";AAIa,MAAAA,IAAuE,OAAO,eAAe;AAMnG,SAASC,IAAqE;AAE5E,SADSC,EAAOF,GAAkB,MAAS;AAEpD;AAEa,MAAAG,IAAuB,CAACC,MAAwC;AACrE,QAAAC,IAAUC,EAAS,MAChBF,EAAM,WAAW,MACzB;AAED,SAAAG,EAAQP,GAAkBK,CAAO,GAE1BA;AACT;"}
@@ -7,7 +7,7 @@ import D from "../../error/OrionError.js";
7
7
  import { useFormItemSpan as w, useFormItemRules as S, useFormItemStringModel as R, useFormItemDisabled as ie, useFormItemCode as K, useFormItemMultiModel as pe, useFormContext as P, useFormItemBooleanModel as me } from "./hooks/index.js";
8
8
  import { getSingleCodeContent as $e, getMultiCodeContent as Ie } from "./utils/index.js";
9
9
  import { S as Te } from "../../index-BbsXWo7C.js";
10
- import { g as Ue, h as Ne, j as Pe } from "../../index-ChkLOmNK.js";
10
+ import { g as Ue, h as Ne, j as Pe } from "../../index-Bm0F5NQQ.js";
11
11
  import { lovContextKey as Ye } from "./LovInput/LovInput.js";
12
12
  import { tableSelectContext as je } from "./TableSelect/TableSelect.js";
13
13
  import { default as Sl } from "./LovInput/hooks/useLov.js";
@@ -52,7 +52,8 @@ const Ge = /* @__PURE__ */ v({
52
52
  model: t.modelValue,
53
53
  rules: t.rules,
54
54
  "label-width": t.itemLabelWidth,
55
- disabled: t.disabled
55
+ disabled: t.disabled,
56
+ class: "orion-form"
56
57
  }, {
57
58
  default: d(() => [
58
59
  b(e(Ce), { gutter: 16 }, {
@@ -642,7 +643,7 @@ const Ge = /* @__PURE__ */ v({
642
643
  default: d(() => [
643
644
  b(e(Te), {
644
645
  gutter: n.gutter,
645
- style: { "margin-bottom": "18px" }
646
+ style: { "margin-bottom": "var(--orion-form-validation-message-height)" }
646
647
  }, {
647
648
  default: d(() => [
648
649
  T(n.$slots, "default")
@@ -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/TableSelect/TableSelect.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\" @change=\"attrs.onChange as any\">\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, useAttrs } 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\nconst attrs = useAttrs()\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\r\n v-else\r\n v-model=\"elModel\"\r\n :placeholder=\"placeholder\"\r\n multiple\r\n :collapse-tags=\"collapseTags\"\r\n :collapse-tags-tooltip=\"collapseTagsTooltip\"\r\n @change=\"attrs.onChange as any\"\r\n >\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, useAttrs } 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\nconst attrs = useAttrs()\r\n\r\nconst { name, label, labelWidth, required, placeholder, collapseTags, collapseTagsTooltip } = 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 ref=\"input\" v-model=\"elModel\" :maxlength=\"maxlength\" :placeholder=\"placeholder\" :disabled=\"disabled\"\r\n :readonly=\"readonly\" @input=\"onInput\" @keydown=\"onKeydown\" @change=\"onChange\" @blur=\"onBlur\"\r\n :suffix-icon=\"Search\" />\r\n <template #dropdown>\r\n <slot></slot>\r\n </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 inputRef = useTemplateRef('input')\r\nconst onBlur = async (e: any) => {\r\n if (visible.value) {\r\n inputRef.value!.focus()\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","<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 <div @focus=\"onFocus\" :style=\"{ position: 'relative', width: '100%', height: '100%' }\">\r\n <el-input ref=\"input\" v-model=\"inputValue\" :maxlength=\"maxlength\" :placeholder=\"placeholder\"\r\n :disabled=\"disabled\" :readonly=\"readonly\" @input=\"onInput\" @keydown=\"onKeydown\" @blur=\"onBlur\"\r\n :suffix-icon=\"visible ? ArrowUp : ArrowDown\" />\r\n <div v-if=\"!visible\"\r\n :style=\"{ position: 'absolute', inset: '4px 30px 4px 4px', overflow: 'hidden', pointerEvents: 'none' }\">\r\n <o-space>\r\n <el-tag v-for=\"tag in tags\" type=\"info\">{{ tag }}</el-tag>\r\n </o-space>\r\n </div>\r\n </div>\r\n <template #dropdown>\r\n <slot></slot>\r\n </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, ElTag } from 'element-plus'\r\nimport { ArrowDown, ArrowUp } from '@element-plus/icons-vue'\r\nimport { RowCompletionProvider, TableSelectContext, tableSelectContext, type TableSelectProps } from './TableSelect'\r\nimport { useFormItemSpan, useFormItemRules, useFormContext } from '../hooks'\r\nimport { computed, onMounted, provide, reactive, ref, useTemplateRef, watch } from 'vue'\r\nimport { isArray, pick } from 'lodash-es'\r\nimport OrionError from '../../../error/OrionError'\r\n\r\ndefineOptions({ name: 'OFormTableselect', inheritAttrs: false })\r\n\r\nconst emit = defineEmits(['change'])\r\nconst { name, label, labelWidth, required, maxlength, placeholder, disabled, readonly, pick: pickup, tag } = defineProps<TableSelectProps>()\r\nconst normalizedSpan = useFormItemSpan()\r\nconst normalizedRules = useFormItemRules()\r\n\r\nconst inputValue = ref('')\r\nconst modifyByForm = ref(false)\r\nconst formContext = useFormContext()!\r\nconst elModel = computed<any[] | undefined>({\r\n get: () => {\r\n const value = formContext.modelValue[name]\r\n if (!value) {\r\n return undefined\r\n }\r\n if (!isArray(value)) {\r\n throw new OrionError('表格下拉框的值只能为数组类型')\r\n }\r\n return value\r\n },\r\n set: (newValue) => {\r\n modifyByForm.value = false\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\nconst selection = ref<any[] | undefined>([])\r\nonMounted(async () => {\r\n if (completionItemProvider) {\r\n selection.value = await completionItemProvider(elModel.value)\r\n if (selection.value) {\r\n tags.value = selection.value.map((item) => tag(item))\r\n }\r\n }\r\n})\r\nwatch(elModel, async () => {\r\n if (modifyByForm.value) {\r\n if (completionItemProvider) {\r\n selection.value = await completionItemProvider(elModel.value)\r\n if (selection.value) {\r\n tags.value = selection.value.map((item) => tag(item))\r\n }\r\n }\r\n } else {\r\n modifyByForm.value = true\r\n }\r\n})\r\n\r\nconst visible = ref(false)\r\nconst onVisibleChange = (val: boolean) => {\r\n visible.value = val\r\n}\r\nconst onInput = () => {\r\n if (!visible.value) {\r\n dropdownRef.value!.handleOpen()\r\n }\r\n}\r\n\r\nconst inputRef = useTemplateRef('input')\r\nconst onFocus = () => {\r\n inputRef.value!.focus()\r\n}\r\n\r\nconst onKeydown = (e: any) => {\r\n if (visible.value) {\r\n if (['Enter', 'Escape'].indexOf(e.code) > -1) {\r\n dropdownRef.value!.handleClose()\r\n } else if ('ArrowDown' == e.code) {\r\n e.stopPropagation()\r\n } else if ('Tab' == e.code) {\r\n visible.value = false\r\n dropdownRef.value!.handleClose()\r\n }\r\n } else {\r\n if (['ArrowUp', 'ArrowDown'].indexOf(e.code) > -1) {\r\n dropdownRef.value!.handleOpen()\r\n e.stopPropagation()\r\n }\r\n }\r\n}\r\n\r\nconst onBlur = async (e: any) => {\r\n if (visible.value) {\r\n inputRef.value!.focus()\r\n } else {\r\n inputValue.value = ''\r\n }\r\n}\r\n\r\nconst tags = ref<string[]>([])\r\nconst dropdownRef = useTemplateRef('dropdown')\r\nconst onSelect: TableSelectContext['onSelect'] = (selection, clear) => {\r\n elModel.value = selection.map((item) => pick(item, pickup))\r\n tags.value = selection.map((item) => tag(item))\r\n if (clear) {\r\n inputValue.value = ''\r\n }\r\n emit('change', selection)\r\n}\r\nconst selectDone: TableSelectContext['selectDone'] = () => {\r\n dropdownRef.value!.handleClose()\r\n}\r\n\r\nlet completionItemProvider: RowCompletionProvider | undefined\r\nconst registerRowCompletionProvider: TableSelectContext['registerRowCompletionProvider'] = (provider) => {\r\n completionItemProvider = provider\r\n}\r\n\r\nprovide(\r\n tableSelectContext,\r\n reactive({\r\n inputValue,\r\n selection,\r\n onSelect,\r\n selectDone,\r\n tag,\r\n registerRowCompletionProvider\r\n })\r\n)\r\n</script>","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\nimport TableSelect from './TableSelect/TableSelect.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 TableSelect: typeof TableSelect\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 TableSelect,\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\nexport * from './TableSelect'\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","attrs","useAttrs","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","inputRef","onBlur","onChange","pairs","i","dstName","lovContextKey","params","srcName","srcValue","isNumber","toNumber","inputValue","modifyByForm","isArray","selection","completionItemProvider","tags","item","onFocus","onSelect","clear","pick","selectDone","registerRowCompletionProvider","provider","tableSelectContext","index","withInstall","Form","StringInput","PasswordInput","Textarea","SingleSelect","MultiSelect","RadioGroup","CheckboxGroup","Checkbox","Switch","DateInput","FileInput","ButtonGroup","DiyItem","LovInput","NumberInput","TableSelect"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AAmBA,UAAMA,IAAOC,GAEPC,IAAmB,CAACC,GAAcC,MAAe;AACjD,UAAA,CAAC,OAAO,KAAKC,EAAA,UAAU,EAAE,SAASF,CAAI;AACxC,cAAM,IAAIG,EAAW,kBAAkBH,CAAI,GAAG;AAE3C,MAAAH,EAAA,qBAAqB,EAAE,GAAGK,cAAY,CAACF,CAAI,GAAGC,EAAA,CAAO;AAAA,IAAA,GAGtDG,IAAwB,CAACC,MAA8B;AAC3D,YAAMC,IAAY,OAAO,KAAKJ,EAAA,UAAU,GAClCK,IAAW,OAAO,KAAKF,CAAI,GAC3BG,IAAOC,GAAWF,GAAUD,CAAS;AACvC,UAAA,CAACI,GAAQF,CAAI;AACf,cAAM,IAAIL,EAAW,kBAAkBK,EAAK,KAAK,GAAG,CAAC,GAAG;AAE1D,MAAAX,EAAK,qBAAqB,EAAE,GAAGK,EAAU,YAAE,GAAGG,GAAM;AAAA,IAAA,GAGhDM,IAAUC,EAAe,MAAM;AAMxB,WAAAC,EAAA;AAAA,MACX,UALuC,YAChC,MAAMF,EAAQ,MAAO;IAI5B,CACD,GAEDG;AA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AAA,QACF,+BAAAwF;AAAA,MAAA,CACD;AAAA,IAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ICtIYG,KAAAC,GAoBbC,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;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/TableSelect/TableSelect.vue","../../../src/components/Form/index.ts"],"sourcesContent":["<template>\r\n <el-form ref=\"form\" :model=\"modelValue\" :rules=\"rules\" :label-width=\"itemLabelWidth\" :disabled=\"disabled\" class=\"orion-form\">\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\" @change=\"attrs.onChange as any\">\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, useAttrs } 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\nconst attrs = useAttrs()\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\r\n v-else\r\n v-model=\"elModel\"\r\n :placeholder=\"placeholder\"\r\n multiple\r\n :collapse-tags=\"collapseTags\"\r\n :collapse-tags-tooltip=\"collapseTagsTooltip\"\r\n @change=\"attrs.onChange as any\"\r\n >\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, useAttrs } 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\nconst attrs = useAttrs()\r\n\r\nconst { name, label, labelWidth, required, placeholder, collapseTags, collapseTagsTooltip } = 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: var(--orion-form-validation-message-height)\"> <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 ref=\"input\" v-model=\"elModel\" :maxlength=\"maxlength\" :placeholder=\"placeholder\" :disabled=\"disabled\"\r\n :readonly=\"readonly\" @input=\"onInput\" @keydown=\"onKeydown\" @change=\"onChange\" @blur=\"onBlur\"\r\n :suffix-icon=\"Search\" />\r\n <template #dropdown>\r\n <slot></slot>\r\n </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 inputRef = useTemplateRef('input')\r\nconst onBlur = async (e: any) => {\r\n if (visible.value) {\r\n inputRef.value!.focus()\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","<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 <div @focus=\"onFocus\" :style=\"{ position: 'relative', width: '100%', height: '100%' }\">\r\n <el-input ref=\"input\" v-model=\"inputValue\" :maxlength=\"maxlength\" :placeholder=\"placeholder\"\r\n :disabled=\"disabled\" :readonly=\"readonly\" @input=\"onInput\" @keydown=\"onKeydown\" @blur=\"onBlur\"\r\n :suffix-icon=\"visible ? ArrowUp : ArrowDown\" />\r\n <div v-if=\"!visible\"\r\n :style=\"{ position: 'absolute', inset: '4px 30px 4px 4px', overflow: 'hidden', pointerEvents: 'none' }\">\r\n <o-space>\r\n <el-tag v-for=\"tag in tags\" type=\"info\">{{ tag }}</el-tag>\r\n </o-space>\r\n </div>\r\n </div>\r\n <template #dropdown>\r\n <slot></slot>\r\n </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, ElTag } from 'element-plus'\r\nimport { ArrowDown, ArrowUp } from '@element-plus/icons-vue'\r\nimport { RowCompletionProvider, TableSelectContext, tableSelectContext, type TableSelectProps } from './TableSelect'\r\nimport { useFormItemSpan, useFormItemRules, useFormContext } from '../hooks'\r\nimport { computed, onMounted, provide, reactive, ref, useTemplateRef, watch } from 'vue'\r\nimport { isArray, pick } from 'lodash-es'\r\nimport OrionError from '../../../error/OrionError'\r\n\r\ndefineOptions({ name: 'OFormTableselect', inheritAttrs: false })\r\n\r\nconst emit = defineEmits(['change'])\r\nconst { name, label, labelWidth, required, maxlength, placeholder, disabled, readonly, pick: pickup, tag } = defineProps<TableSelectProps>()\r\nconst normalizedSpan = useFormItemSpan()\r\nconst normalizedRules = useFormItemRules()\r\n\r\nconst inputValue = ref('')\r\nconst modifyByForm = ref(false)\r\nconst formContext = useFormContext()!\r\nconst elModel = computed<any[] | undefined>({\r\n get: () => {\r\n const value = formContext.modelValue[name]\r\n if (!value) {\r\n return undefined\r\n }\r\n if (!isArray(value)) {\r\n throw new OrionError('表格下拉框的值只能为数组类型')\r\n }\r\n return value\r\n },\r\n set: (newValue) => {\r\n modifyByForm.value = false\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\nconst selection = ref<any[] | undefined>([])\r\nonMounted(async () => {\r\n if (completionItemProvider) {\r\n selection.value = await completionItemProvider(elModel.value)\r\n if (selection.value) {\r\n tags.value = selection.value.map((item) => tag(item))\r\n }\r\n }\r\n})\r\nwatch(elModel, async () => {\r\n if (modifyByForm.value) {\r\n if (completionItemProvider) {\r\n selection.value = await completionItemProvider(elModel.value)\r\n if (selection.value) {\r\n tags.value = selection.value.map((item) => tag(item))\r\n }\r\n }\r\n } else {\r\n modifyByForm.value = true\r\n }\r\n})\r\n\r\nconst visible = ref(false)\r\nconst onVisibleChange = (val: boolean) => {\r\n visible.value = val\r\n}\r\nconst onInput = () => {\r\n if (!visible.value) {\r\n dropdownRef.value!.handleOpen()\r\n }\r\n}\r\n\r\nconst inputRef = useTemplateRef('input')\r\nconst onFocus = () => {\r\n inputRef.value!.focus()\r\n}\r\n\r\nconst onKeydown = (e: any) => {\r\n if (visible.value) {\r\n if (['Enter', 'Escape'].indexOf(e.code) > -1) {\r\n dropdownRef.value!.handleClose()\r\n } else if ('ArrowDown' == e.code) {\r\n e.stopPropagation()\r\n } else if ('Tab' == e.code) {\r\n visible.value = false\r\n dropdownRef.value!.handleClose()\r\n }\r\n } else {\r\n if (['ArrowUp', 'ArrowDown'].indexOf(e.code) > -1) {\r\n dropdownRef.value!.handleOpen()\r\n e.stopPropagation()\r\n }\r\n }\r\n}\r\n\r\nconst onBlur = async (e: any) => {\r\n if (visible.value) {\r\n inputRef.value!.focus()\r\n } else {\r\n inputValue.value = ''\r\n }\r\n}\r\n\r\nconst tags = ref<string[]>([])\r\nconst dropdownRef = useTemplateRef('dropdown')\r\nconst onSelect: TableSelectContext['onSelect'] = (selection, clear) => {\r\n elModel.value = selection.map((item) => pick(item, pickup))\r\n tags.value = selection.map((item) => tag(item))\r\n if (clear) {\r\n inputValue.value = ''\r\n }\r\n emit('change', selection)\r\n}\r\nconst selectDone: TableSelectContext['selectDone'] = () => {\r\n dropdownRef.value!.handleClose()\r\n}\r\n\r\nlet completionItemProvider: RowCompletionProvider | undefined\r\nconst registerRowCompletionProvider: TableSelectContext['registerRowCompletionProvider'] = (provider) => {\r\n completionItemProvider = provider\r\n}\r\n\r\nprovide(\r\n tableSelectContext,\r\n reactive({\r\n inputValue,\r\n selection,\r\n onSelect,\r\n selectDone,\r\n tag,\r\n registerRowCompletionProvider\r\n })\r\n)\r\n</script>","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\nimport TableSelect from './TableSelect/TableSelect.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 TableSelect: typeof TableSelect\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 TableSelect,\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\nexport * from './TableSelect'\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","attrs","useAttrs","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","inputRef","onBlur","onChange","pairs","i","dstName","lovContextKey","params","srcName","srcValue","isNumber","toNumber","inputValue","modifyByForm","isArray","selection","completionItemProvider","tags","item","onFocus","onSelect","clear","pick","selectDone","registerRowCompletionProvider","provider","tableSelectContext","index","withInstall","Form","StringInput","PasswordInput","Textarea","SingleSelect","MultiSelect","RadioGroup","CheckboxGroup","Checkbox","Switch","DateInput","FileInput","ButtonGroup","DiyItem","LovInput","NumberInput","TableSelect"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AAmBA,UAAMA,IAAOC,GAEPC,IAAmB,CAACC,GAAcC,MAAe;AACjD,UAAA,CAAC,OAAO,KAAKC,EAAA,UAAU,EAAE,SAASF,CAAI;AACxC,cAAM,IAAIG,EAAW,kBAAkBH,CAAI,GAAG;AAE3C,MAAAH,EAAA,qBAAqB,EAAE,GAAGK,cAAY,CAACF,CAAI,GAAGC,EAAA,CAAO;AAAA,IAAA,GAGtDG,IAAwB,CAACC,MAA8B;AAC3D,YAAMC,IAAY,OAAO,KAAKJ,EAAA,UAAU,GAClCK,IAAW,OAAO,KAAKF,CAAI,GAC3BG,IAAOC,GAAWF,GAAUD,CAAS;AACvC,UAAA,CAACI,GAAQF,CAAI;AACf,cAAM,IAAIL,EAAW,kBAAkBK,EAAK,KAAK,GAAG,CAAC,GAAG;AAE1D,MAAAX,EAAK,qBAAqB,EAAE,GAAGK,EAAU,YAAE,GAAGG,GAAM;AAAA,IAAA,GAGhDM,IAAUC,EAAe,MAAM;AAMxB,WAAAC,EAAA;AAAA,MACX,UALuC,YAChC,MAAMF,EAAQ,MAAO;IAI5B,CACD,GAEDG;AAAA,MACEC;AAAA,MACAC,EAAS;AAAA,QACP,YAAY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IAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ICtIYG,KAAAC,GAoBbC,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;AAAAA,EAAA,aACAC;AACF,CAAC;"}
@@ -1,36 +1,38 @@
1
1
  import "lodash-es";
2
- import { defineComponent as g, inject as L, ref as o, shallowRef as O, provide as M, createVNode as w, Fragment as P, useTemplateRef as k, openBlock as E, createElementBlock as T, renderSlot as b } from "vue";
2
+ import { defineComponent as C, inject as L, ref as o, shallowRef as O, provide as y, createVNode as g, Fragment as P, useTemplateRef as k, openBlock as E, createElementBlock as T, renderSlot as b } from "vue";
3
3
  import { withInstall as j } from "../_util/vue/install.js";
4
4
  import { ElDialog as B } from "element-plus";
5
5
  import { addUnit as I } from "../_util/dom/style.js";
6
- import { modalLocatorContextKey as x, modalContextKey as K } from "./types.js";
7
- const R = /* @__PURE__ */ g({
6
+ import { modalLocatorContextKey as M, modalContextKey as K } from "./types.js";
7
+ const R = /* @__PURE__ */ C({
8
8
  name: "OModal",
9
- setup(l, {
9
+ setup(t, {
10
10
  slots: a,
11
- attrs: t,
12
- emit: u,
13
- expose: c
11
+ attrs: l,
12
+ emit: c,
13
+ expose: u
14
14
  }) {
15
- const d = L(x), n = o(!1), i = o(), v = O(), r = o(), f = o(), m = o(), h = o(), p = o(!0), s = o();
16
- c({
17
- open: async (e) => (n.value = !0, i.value = e.title, v.value = e.content, e.contentProps ? r.value = e.contentProps : r.value = {}, e.width && (f.value = e.width), e.height && (m.value = I(e.height)), e.showClose != null && e.showClose == !1 && (p.value = !1), e.locator ? s.value = e.locator : d && d.locator.value && (s.value = d.locator.value), new Promise((y, S) => {
18
- h.value = y;
15
+ const d = L(M), n = o(!1), i = o(), v = O(), r = o(), f = o(), m = o(), h = o(), p = o(!0), s = o();
16
+ u({
17
+ open: async (e) => (n.value = !0, i.value = e.title, v.value = e.content, e.contentProps ? r.value = e.contentProps : r.value = {}, e.width && (f.value = e.width), e.height && (m.value = I(e.height)), e.showClose != null && e.showClose == !1 && (p.value = !1), e.locator ? s.value = e.locator : d && d.locator.value && (s.value = d.locator.value), new Promise((x, S) => {
18
+ h.value = x;
19
19
  }))
20
20
  });
21
- const C = (e) => {
21
+ const w = (e) => {
22
22
  const _ = h.value;
23
23
  n.value = !1, i.value = void 0, v.value = void 0, r.value = void 0, f.value = void 0, m.value = void 0, h.value = void 0, p.value = !0, s.value = void 0, _ && _(e);
24
24
  };
25
- return M(K, {
26
- close: C
25
+ return y(K, {
26
+ close: w
27
27
  }), () => {
28
28
  const e = v.value;
29
- return n.value ? w(B, {
29
+ return n.value ? g(B, {
30
+ class: "orion-dialog",
31
+ "modal-class": "orion-dialog-overlay",
30
32
  title: i.value,
31
33
  width: f.value,
32
34
  modelValue: n.value,
33
- beforeClose: C,
35
+ beforeClose: w,
34
36
  draggable: !0,
35
37
  closeOnClickModal: !1,
36
38
  closeOnPressEscape: !1,
@@ -41,30 +43,30 @@ const R = /* @__PURE__ */ g({
41
43
  },
42
44
  appendTo: s.value
43
45
  }, {
44
- default: () => [w(e, r.value, null)]
45
- }) : w(P, null, null);
46
+ default: () => [g(e, r.value, null)]
47
+ }) : g(P, null, null);
46
48
  };
47
49
  }
48
50
  }), V = {
49
51
  ref: "modal-locator",
50
52
  class: "orion-modal-locator"
51
- }, A = /* @__PURE__ */ g({
53
+ }, A = /* @__PURE__ */ C({
52
54
  name: "OModalLocator",
53
55
  inheritAttrs: !0,
54
56
  __name: "ModalLocator",
55
- setup(l) {
57
+ setup(t) {
56
58
  const a = k("modal-locator");
57
- return M(x, {
59
+ return y(M, {
58
60
  locator: a
59
- }), (t, u) => (E(), T("div", V, [
60
- b(t.$slots, "default", {}, void 0, !0)
61
+ }), (l, c) => (E(), T("div", V, [
62
+ b(l.$slots, "default", {}, void 0, !0)
61
63
  ], 512));
62
64
  }
63
- }), D = (l, a) => {
64
- const t = l.__vccOpts || l;
65
- for (const [u, c] of a)
66
- t[u] = c;
67
- return t;
65
+ }), D = (t, a) => {
66
+ const l = t.__vccOpts || t;
67
+ for (const [c, u] of a)
68
+ l[c] = u;
69
+ return l;
68
70
  }, F = /* @__PURE__ */ D(A, [["__scopeId", "data-v-0fd5a1a9"]]), J = j(R, { ModalLocator: F });
69
71
  export {
70
72
  J as default
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":["../../../src/components/Modal/Modal.tsx","../../../src/components/Modal/ModalLocator.vue","../../../src/components/Modal/index.ts"],"sourcesContent":["import { defineComponent, inject, provide, ref, shallowRef } from 'vue'\r\nimport { ElDialog } from 'element-plus'\r\nimport { addUnit } from '../_util'\r\nimport { modalContextKey, modalLocatorContextKey, ModalOptions } from './types'\r\n\r\nconst Modal = defineComponent({\r\n name: 'OModal',\r\n setup(props, { slots, attrs, emit, expose }) {\r\n const modalLocator = inject(modalLocatorContextKey)\r\n\r\n const show = ref(false)\r\n const title = ref<string>()\r\n const content = shallowRef()\r\n const contentProps = ref<Record<string, any>>()\r\n const width = ref<number | string>()\r\n const height = ref<number | string>()\r\n const __resolve = ref<(value: Record<string, any> | PromiseLike<Record<string, any>>) => void>()\r\n const showClose = ref(true)\r\n const appendTo = ref<HTMLElement>()\r\n\r\n const _open: (options: ModalOptions) => Promise<Record<string, any>> = async (options) => {\r\n show.value = true\r\n title.value = options.title\r\n content.value = options.content\r\n if (options.contentProps) {\r\n contentProps.value = options.contentProps\r\n } else {\r\n contentProps.value = {}\r\n }\r\n if (options.width) {\r\n width.value = options.width\r\n }\r\n if (options.height) {\r\n height.value = addUnit(options.height)\r\n }\r\n if (options.showClose != undefined && options.showClose == false) {\r\n showClose.value = false\r\n }\r\n if (options.locator) {\r\n appendTo.value = options.locator\r\n } else {\r\n if (modalLocator && modalLocator.locator.value) {\r\n appendTo.value = modalLocator.locator.value\r\n }\r\n }\r\n\r\n const promise = new Promise<Record<string, any>>((resolve, reject) => {\r\n __resolve.value = resolve\r\n })\r\n\r\n return promise\r\n }\r\n expose({\r\n open: _open,\r\n })\r\n\r\n const _close: (options: Record<string, any>) => void = (options) => {\r\n const resolve = __resolve.value\r\n\r\n show.value = false\r\n title.value = undefined\r\n content.value = undefined\r\n contentProps.value = undefined\r\n width.value = undefined\r\n height.value = undefined\r\n __resolve.value = undefined\r\n showClose.value = true\r\n appendTo.value = undefined\r\n\r\n resolve && resolve(options)\r\n }\r\n provide(modalContextKey, { close: _close })\r\n\r\n return () => {\r\n const Children = content.value\r\n return show.value ? (\r\n <ElDialog\r\n title={title.value}\r\n width={width.value}\r\n modelValue={show.value}\r\n beforeClose={_close}\r\n draggable={true}\r\n closeOnClickModal={false}\r\n closeOnPressEscape={false}\r\n showClose={showClose.value}\r\n alignCenter={true}\r\n style={{ height: height.value }}\r\n appendTo={appendTo.value}\r\n >\r\n <Children {...contentProps.value}></Children>\r\n </ElDialog>\r\n ) : (\r\n <></>\r\n )\r\n }\r\n },\r\n})\r\n\r\nexport default Modal\r\n","<template>\r\n <div ref=\"modal-locator\" class=\"orion-modal-locator\"><slot></slot></div>\r\n</template>\r\n<script setup lang=\"ts\">\r\nimport { provide, useTemplateRef } from 'vue'\r\nimport { modalLocatorContextKey } from './types'\r\n\r\ndefineOptions({ name: 'OModalLocator', inheritAttrs: true })\r\nconst locator = useTemplateRef('modal-locator')\r\n\r\nprovide(modalLocatorContextKey, {\r\n locator,\r\n})\r\n</script>\r\n<style lang=\"scss\" scoped>\r\n.orion-modal-locator {\r\n width: 100%;\r\n height: 100%;\r\n overflow: auto;\r\n box-sizing: border-box;\r\n position: relative;\r\n\r\n :deep(> .el-overlay) {\r\n position: absolute;\r\n\r\n > .el-overlay-dialog {\r\n position: absolute;\r\n }\r\n }\r\n}\r\n</style>\r\n","import { withInstall } from '../_util'\r\n\r\nimport Modal from './Modal'\r\nimport ModalLocator from './ModalLocator.vue'\r\n\r\nexport default withInstall<typeof Modal, { ModalLocator: typeof ModalLocator }>(Modal, { ModalLocator })\r\n"],"names":["Modal","defineComponent","name","setup","props","slots","attrs","emit","expose","modalLocator","inject","modalLocatorContextKey","show","ref","title","content","shallowRef","contentProps","width","height","__resolve","showClose","appendTo","open","options","value","addUnit","undefined","locator","Promise","resolve","reject","_close","provide","modalContextKey","close","Children","_createVNode","ElDialog","default","_Fragment","useTemplateRef","index","withInstall","ModalLocator"],"mappings":";;;;;;AAKA,MAAMA,IAAQC,gBAAAA,EAAgB;AAAA,EAC5BC,MAAM;AAAA,EACNC,MAAMC,GAAO;AAAA,IAAEC,OAAAA;AAAAA,IAAOC,OAAAA;AAAAA,IAAOC,MAAAA;AAAAA,IAAMC,QAAAA;AAAAA,EAAO,GAAG;AAC3C,UAAMC,IAAeC,EAAOC,CAAsB,GAE5CC,IAAOC,EAAI,EAAK,GAChBC,IAAQD,KACRE,IAAUC,KACVC,IAAeJ,KACfK,IAAQL,KACRM,IAASN,KACTO,IAAYP,KACZQ,IAAYR,EAAI,EAAI,GACpBS,IAAWT;AAkCjBL,IAAAA,EAAO;AAAA,MACLe,MAjCqE,OAAOC,OAC5EZ,EAAKa,QAAQ,IACbX,EAAMW,QAAQD,EAAQV,OACtBC,EAAQU,QAAQD,EAAQT,SACpBS,EAAQP,eACVA,EAAaQ,QAAQD,EAAQP,eAE7BA,EAAaQ,QAAQ,IAEnBD,EAAQN,UACVA,EAAMO,QAAQD,EAAQN,QAEpBM,EAAQL,WACVA,EAAOM,QAAQC,EAAQF,EAAQL,MAAM,IAEnCK,EAAQH,aAAaM,QAAaH,EAAQH,aAAa,OACzDA,EAAUI,QAAQ,KAEhBD,EAAQI,UACVN,EAASG,QAAQD,E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AE,cAAA4C,GAAc;"}
1
+ {"version":3,"file":"index.js","sources":["../../../src/components/Modal/Modal.tsx","../../../src/components/Modal/ModalLocator.vue","../../../src/components/Modal/index.ts"],"sourcesContent":["import { defineComponent, inject, provide, ref, shallowRef } from 'vue'\r\nimport { ElDialog } from 'element-plus'\r\nimport { addUnit } from '../_util'\r\nimport { modalContextKey, modalLocatorContextKey, ModalOptions } from './types'\r\n\r\nconst Modal = defineComponent({\r\n name: 'OModal',\r\n setup(props, { slots, attrs, emit, expose }) {\r\n const modalLocator = inject(modalLocatorContextKey)\r\n\r\n const show = ref(false)\r\n const title = ref<string>()\r\n const content = shallowRef()\r\n const contentProps = ref<Record<string, any>>()\r\n const width = ref<number | string>()\r\n const height = ref<number | string>()\r\n const __resolve = ref<(value: Record<string, any> | PromiseLike<Record<string, any>>) => void>()\r\n const showClose = ref(true)\r\n const appendTo = ref<HTMLElement>()\r\n\r\n const _open: (options: ModalOptions) => Promise<Record<string, any>> = async (options) => {\r\n show.value = true\r\n title.value = options.title\r\n content.value = options.content\r\n if (options.contentProps) {\r\n contentProps.value = options.contentProps\r\n } else {\r\n contentProps.value = {}\r\n }\r\n if (options.width) {\r\n width.value = options.width\r\n }\r\n if (options.height) {\r\n height.value = addUnit(options.height)\r\n }\r\n if (options.showClose != undefined && options.showClose == false) {\r\n showClose.value = false\r\n }\r\n if (options.locator) {\r\n appendTo.value = options.locator\r\n } else {\r\n if (modalLocator && modalLocator.locator.value) {\r\n appendTo.value = modalLocator.locator.value\r\n }\r\n }\r\n\r\n const promise = new Promise<Record<string, any>>((resolve, reject) => {\r\n __resolve.value = resolve\r\n })\r\n\r\n return promise\r\n }\r\n expose({\r\n open: _open,\r\n })\r\n\r\n const _close: (options: Record<string, any>) => void = (options) => {\r\n const resolve = __resolve.value\r\n\r\n show.value = false\r\n title.value = undefined\r\n content.value = undefined\r\n contentProps.value = undefined\r\n width.value = undefined\r\n height.value = undefined\r\n __resolve.value = undefined\r\n showClose.value = true\r\n appendTo.value = undefined\r\n\r\n resolve && resolve(options)\r\n }\r\n provide(modalContextKey, { close: _close })\r\n\r\n return () => {\r\n const Children = content.value\r\n return show.value ? (\r\n <ElDialog\r\n class=\"orion-dialog\"\r\n modal-class=\"orion-dialog-overlay\"\r\n title={title.value}\r\n width={width.value}\r\n modelValue={show.value}\r\n beforeClose={_close}\r\n draggable={true}\r\n closeOnClickModal={false}\r\n closeOnPressEscape={false}\r\n showClose={showClose.value}\r\n alignCenter={true}\r\n style={{ height: height.value }}\r\n appendTo={appendTo.value}\r\n >\r\n <Children {...contentProps.value}></Children>\r\n </ElDialog>\r\n ) : (\r\n <></>\r\n )\r\n }\r\n },\r\n})\r\n\r\nexport default Modal\r\n","<template>\r\n <div ref=\"modal-locator\" class=\"orion-modal-locator\"><slot></slot></div>\r\n</template>\r\n<script setup lang=\"ts\">\r\nimport { provide, useTemplateRef } from 'vue'\r\nimport { modalLocatorContextKey } from './types'\r\n\r\ndefineOptions({ name: 'OModalLocator', inheritAttrs: true })\r\nconst locator = useTemplateRef('modal-locator')\r\n\r\nprovide(modalLocatorContextKey, {\r\n locator,\r\n})\r\n</script>\r\n<style lang=\"scss\" scoped>\r\n.orion-modal-locator {\r\n width: 100%;\r\n height: 100%;\r\n overflow: auto;\r\n box-sizing: border-box;\r\n position: relative;\r\n\r\n :deep(> .el-overlay) {\r\n position: absolute;\r\n\r\n > .el-overlay-dialog {\r\n position: absolute;\r\n }\r\n }\r\n}\r\n</style>\r\n","import { withInstall } from '../_util'\r\n\r\nimport Modal from './Modal'\r\nimport ModalLocator from './ModalLocator.vue'\r\n\r\nexport default withInstall<typeof Modal, { ModalLocator: typeof ModalLocator }>(Modal, { ModalLocator })\r\n"],"names":["Modal","defineComponent","name","setup","props","slots","attrs","emit","expose","modalLocator","inject","modalLocatorContextKey","show","ref","title","content","shallowRef","contentProps","width","height","__resolve","showClose","appendTo","open","options","value","addUnit","undefined","locator","Promise","resolve","reject","_close","provide","modalContextKey","close","Children","_createVNode","ElD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AUI,QAAQ,IAClBH,EAASG,QAAQE,QAEjBG,KAAWA,EAAQN,CAAO;AAAA;AAE5BS,WAAAA,EAAQC,GAAiB;AAAA,MAAEC,OAAOH;AAAAA,IAAO,CAAC,GAEnC,MAAM;AACX,YAAMI,IAAWrB,EAAQU;AACzB,aAAOb,EAAKa,QAAKY,EAAAC,GAAA;AAAA,QAAA,OAAA;AAAA,QAAA,eAAA;AAAA,QAAA,OAINxB,EAAMW;AAAAA,QAAK,OACXP,EAAMO;AAAAA,QAAK,YACNb,EAAKa;AAAAA,QAAK,aACTO;AAAAA,QAAM,WACR;AAAA,QAAI,mBACI;AAAA,QAAK,oBACJ;AAAA,QAAK,WACdX,EAAUI;AAAAA,QAAK,aACb;AAAA,QAAI,OACV;AAAA,UAAEN,QAAQA,EAAOM;AAAAA,QAAO;AAAA,QAAA,UACrBH,EAASG;AAAAA,MAAK,GAAA;AAAA,QAAAc,SAAAA,MAAAF,CAAAA,EAAAD,GAEVnB,EAAaQ,OAAK,IAAA,CAAA;AAAA,MAAAY,CAAAA,IAAAA,EAAAG,GAInC,MAAA,IAAA;AAAA;EAEL;AACF,CAAC;;;;;;;;AC1FK,UAAAZ,IAAUa,EAAe,eAAe;AAE9C,WAAAR,EAAQtB,GAAwB;AAAA,MAC9B,SAAAiB;AAAA,IAAA,CACD;;;;;;;;;iECPDc,IAAeC,EAAiE3C,GAAO,EAAE,cAAA4C,GAAc;"}
@@ -37,7 +37,7 @@ const Ae = () => ({
37
37
  emit: s,
38
38
  expose: C
39
39
  }) {
40
- const v = ie(), T = $(() => ({})), B = Se(p), _ = $(() => {
40
+ const v = ie(), k = $(() => ({})), B = Se(p), _ = $(() => {
41
41
  let m = [];
42
42
  o.showRowNumber && m.push({
43
43
  type: "__showRowNumber__"
@@ -47,9 +47,9 @@ const Ae = () => ({
47
47
  function O(d) {
48
48
  if (d)
49
49
  for (let A = 0; A < d.length; A++) {
50
- const k = d[A];
51
- k.type === "OPagetableColumngroup" ? O(k.children) : m.push({
52
- ...k
50
+ const T = d[A];
51
+ T.type === "OPagetableColumngroup" ? O(T.children) : m.push({
52
+ ...T
53
53
  });
54
54
  }
55
55
  }
@@ -88,7 +88,7 @@ const Ae = () => ({
88
88
  pagination: d,
89
89
  paginationTeleported: A
90
90
  } = o, {
91
- showRowNumber: k = !0
91
+ showRowNumber: T = !0
92
92
  } = o, {
93
93
  currentRowMode: G = !1
94
94
  } = o, {
@@ -119,12 +119,15 @@ const Ae = () => ({
119
119
  }, K = ge("orion-pagetbale"), Q = () => a(S, {
120
120
  type: "index",
121
121
  label: "No",
122
+ headerAlign: "center",
123
+ align: "center",
122
124
  width: 56,
123
125
  fixed: p.expandedRowRender ? !1 : "left",
124
126
  showOverflowTooltip: !0,
125
127
  index: (e) => (d.currentPage - 1) * d.pageSize + e + 1
126
128
  }, null), W = () => a(S, {
127
129
  type: "selection",
130
+ align: "center",
128
131
  width: 40,
129
132
  fixed: p.expandedRowRender ? !1 : "left"
130
133
  }, null), X = (e) => {
@@ -391,7 +394,7 @@ const Ae = () => ({
391
394
  });
392
395
  return a("div", {
393
396
  class: [K, y.class],
394
- style: [T.value, y.style]
397
+ style: [k.value, y.style]
395
398
  }, [a("div", {
396
399
  class: "pagetable-wrapper"
397
400
  }, [a(pe, {
@@ -467,7 +470,7 @@ const Ae = () => ({
467
470
  class: "row-expand"
468
471
  }, [t]);
469
472
  }
470
- }), k && Q(), O && W(), E(B.value)]
473
+ }), T && Q(), O && W(), E(B.value)]
471
474
  })]), a("div", {
472
475
  class: "pagination-wrapper"
473
476
  }, [a(ce, {
@@ -488,6 +491,7 @@ const Ae = () => ({
488
491
  },
489
492
  total: d.total,
490
493
  layout: "total, ->, sizes, prev, pager, next, jumper",
494
+ background: !0,
491
495
  size: V,
492
496
  teleported: A
493
497
  }, null)])]);
@@ -533,7 +537,7 @@ const Ae = () => ({
533
537
  width: r([Boolean, String]),
534
538
  fixed: r([Boolean, String]),
535
539
  tail: r([Boolean, String])
536
- }), Te = /* @__PURE__ */ x({
540
+ }), ke = /* @__PURE__ */ x({
537
541
  name: "OPagetableColumnLink",
538
542
  inheritAttrs: !1,
539
543
  props: Re(),
@@ -545,7 +549,7 @@ const Ae = () => ({
545
549
  }) {
546
550
  return () => null;
547
551
  }
548
- }), ke = () => ({
552
+ }), Te = () => ({
549
553
  head: n(),
550
554
  headAlign: n(),
551
555
  bodyAlign: n(),
@@ -559,7 +563,7 @@ const Ae = () => ({
559
563
  }), Ne = /* @__PURE__ */ x({
560
564
  name: "OPagetableColumnNumber",
561
565
  inheritAttrs: !1,
562
- props: ke(),
566
+ props: Te(),
563
567
  setup(o, {
564
568
  slots: p,
565
569
  attrs: y,
@@ -671,17 +675,17 @@ const Ye = () => ({
671
675
  emit: s,
672
676
  expose: C
673
677
  }) {
674
- const v = (T) => {
675
- s("click", T);
678
+ const v = (k) => {
679
+ s("click", k);
676
680
  };
677
681
  return () => {
678
682
  var _;
679
683
  const {
680
- type: T
684
+ type: k
681
685
  } = o, B = (_ = p.default) == null ? void 0 : _.call(p);
682
686
  return a(de, {
683
687
  link: !0,
684
- type: T,
688
+ type: k,
685
689
  size: "small",
686
690
  onClick: v
687
691
  }, Le(B) ? B : {
@@ -727,7 +731,7 @@ const Ye = () => ({
727
731
  }), dt = ue(Pe, {
728
732
  PagetableColumnIndex: Oe,
729
733
  PagetableColumnString: De,
730
- PagetableColumnLink: Te,
734
+ PagetableColumnLink: ke,
731
735
  PagetableColumnNumber: Ne,
732
736
  PagetableColumnDate: Ie,
733
737
  PagetableColumnSingleselect: je,