@dinert/element-plus 1.1.42 → 1.1.44

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -176,7 +176,7 @@ const Fe = /* @__PURE__ */ F({
176
176
  this.$emit("SearchFn");
177
177
  },
178
178
  ref: (s) => this.setFormTypeRefs(e.key, s)
179
- }, o)) : ["input-number"].includes(e.type) ? (d(["decrease-icon", "increase-icon"], this, o, e), t = r(U, {
179
+ }, o)) : ["input-number"].includes(e.type) ? (d(["decrease-icon", "increase-icon", "prefix", "suffix"], this, o, e), t = r(U, {
180
180
  form: this.form,
181
181
  formItem: e,
182
182
  ref: (s) => this.setFormTypeRefs(e.key, s)
@@ -1 +1 @@
1
- {"version":3,"file":"index.mjs","sources":["../../../../../packages/components/form/src/index.tsx"],"sourcesContent":["import {defineComponent, ref, computed, nextTick, toRefs, onBeforeUpdate, withModifiers} from 'vue'\nimport CustomInput from './input'\nimport CustomInputNumber from './input-number'\nimport CustomInputAutocomplete from './input-autocomplete'\nimport CustomSelect from './select'\nimport CustomSelectV2 from './select-v2'\nimport CustomSwitch from './switch'\nimport CustomDate from './date'\nimport CustomRadio from './radio'\nimport CustomSelectTree from './tree-select'\nimport CustomRate from './rate'\nimport CustomCheckbox from './checkbox'\nimport CustomCascader from './cascader'\nimport CustomSlider from './slider'\nimport CustomTimePicker from './time-picker'\nimport CustomTimeSelect from './time-select'\n\nimport useWindowResize from '@packages/hooks/useWindowResize'\nimport {labelMouseEnter, valueMouseEnter, getTooltipValue, getSpanValue, formItemSlot, customPlaceholder, renderSlot} from '@packages/components/form/utils'\n\nimport {dataTransformRod, getUuid} from '@packages/utils/tools'\nimport {ElForm} from 'element-plus'\n\nimport {ArrowUp, ArrowDown} from '@element-plus/icons-vue'\n\n\nimport '@packages/assets/scss/dinert-form.scss'\n\nimport type {PropType} from 'vue'\nimport type {RewriteFormProps, CustomFormItemProps} from '@packages/components/form/types'\n\n// 展开还是收起状态\nexport default defineComponent({\n name: 'dinert-form',\n props: {\n form: {\n type: Object as PropType<RewriteFormProps>,\n default: () => ({})\n },\n search: {\n type: Boolean,\n default: true\n }\n },\n emits: ['UnFold', 'SearchFn', 'ResetFn'],\n setup(props, {emit}) {\n const {form} = toRefs(props)\n const packUp = ref(form.value.packUp === undefined)\n const isArrow = ref(false)\n const formRef = ref<InstanceType<typeof ElForm>>()\n const formTypeRef = ref<any>({})\n const setFormTypeRefs = (type: string, el: any) => {\n formTypeRef.value[type] = el\n }\n const formClass = ref('form_' + getUuid())\n\n onBeforeUpdate(() => {\n formTypeRef.value = {}\n })\n\n const formItemMap = computed(() => {\n const result: any = []\n Object.keys(form.value.formItem).forEach(key => {\n const value = form.value.formItem[key] as Partial<CustomFormItemProps>\n result.push({\n ...value,\n key: key,\n })\n })\n\n result.sort((a: any, b: any) => {\n return (a.sort || Infinity) - (b.sort || Infinity)\n })\n\n return result\n })\n\n const resizeForm = () => {\n let elFormLeft = document.querySelectorAll(`.${formClass.value} .dinert-form-left > div`) as any\n if (elFormLeft[0]) {\n isArrow.value = false\n nextTick(() => {\n const firstTop = elFormLeft[0].getBoundingClientRect().top\n const lastTop = elFormLeft[elFormLeft.length - 1].getBoundingClientRect().top\n const isHeight = firstTop !== lastTop\n if (isHeight) {\n isArrow.value = true\n } else {\n if (!packUp.value) {\n packUp.value = true\n }\n isArrow.value = false\n }\n elFormLeft = null\n })\n\n }\n }\n\n useWindowResize(() => {\n resizeForm()\n }, 100, true)\n\n\n const unfold = () => {\n if (packUp.value) {\n packUp.value = false\n } else {\n packUp.value = true\n }\n\n emit('UnFold', packUp.value)\n }\n\n\n return {\n formItemMap,\n formClass,\n formTypeRef,\n formRef,\n packUp,\n isArrow,\n\n setFormTypeRefs,\n unfold,\n }\n },\n render() {\n return (\n <el-form inline={true}\n {...this.form}\n ref={el => {this.formRef = el}}\n class={[this.formClass, this.packUp ? '' : 'packUp', 'dinert-form']}\n onSubmit={withModifiers(() => undefined, ['stop', 'prevent'])}\n key={this.form.key}>\n\n <el-row {...this.form.row} class=\"dinert-form-left\">\n {/* eslint-disable-next-line array-callback-return, consistent-return */}\n { this.formItemMap.map((item: CustomFormItemProps) => {\n const style: any = {}\n let vif = typeof item.vif === 'function' ? item.vif(this.form.model) : item.vif\n vif = vif === undefined ? typeof this.form.vif === 'function' ? this.form.vif(this.form.model) : vif : vif\n vif = vif === undefined ? true : vif\n\n let show = typeof item.show === 'function' ? item.show(this.form.model) : item.show\n show = show === undefined ? true : show\n item.options = {placeholder: customPlaceholder(typeof item.label === 'function' ? item.label(this.form.model) : item.label, item.type), ...item.options}\n\n\n if (!show) {\n style.display = 'none'\n }\n if (vif) {\n const formShowLabel = typeof this.form.showLabel === 'function' ? this.form.showLabel(this.form.model) : this.form.showLabel\n let itemShowLabel = typeof item.showLabel === 'function' ? item.showLabel(this.form.model) : item.showLabel\n item.required = item.required === undefined ? item.required || this.form.required : item.required\n itemShowLabel = itemShowLabel === undefined ? itemShowLabel || formShowLabel : itemShowLabel\n item.required = itemShowLabel ? false : item.required\n\n let rules = item.rules || []\n rules = item.required ? [{required: true, trigger: ['blur', 'change'], message: customPlaceholder(typeof item.label === 'function' ? item.label(this.form.model) : item.label, item.type)}].concat(rules as any) : rules\n rules = itemShowLabel ? [] : rules\n const valDisabled = item.itemValueDisabled !== undefined ? item.itemValueDisabled : item.tempValueDisabled\n\n return (\n <el-col\n style= {style}\n class={[item.type, item.key]}\n key={item.key}\n {\n ...{\n // xl: 3, // ≥1920px\n // lg: 4, // ≥1200px\n // md: 8, // ≥992px\n // sm: 12, // ≥768px\n // xs: 24, // <768px\n ...this.form.colLayout,\n ...item.colLayout\n }\n }\n >\n <el-form-item\n key={item.key}\n prop={item.key}\n class={[item.labelWrap ? 'label-wrap' : '', itemShowLabel ? 'show-label' : '']}\n {...{\n ...item,\n label: typeof item.label === 'function' ? item.label(this.form.model) : item.label,\n rules: rules\n }}\n v-slots={{\n label: () => {\n if (this.$slots[formItemSlot(item.key, 'formItem_label_')]) {\n return (this.$slots[formItemSlot(item.key, 'formItem_label_')]?.({...item, model: this.form.model}))\n }\n return (\n <dinert-tooltip\n key={item.key}\n content={typeof item.label === 'function' ? item.label(this.form.model) : item.label}\n disabled={item.labelDisabled}\n onLabelMouseEnter={(e: MouseEvent) => {labelMouseEnter(e, item, this)}}\n >\n </dinert-tooltip>\n )\n },\n default: () => {\n return (\n <dinert-tooltip\n key={item.key}\n content={String(getTooltipValue(this.form.model[item.key], item))}\n disabled={valDisabled}\n item={item}\n onLabelMouseEnter={(e: MouseEvent) => valueMouseEnter(e, item, this.form.model[item.key], this, itemShowLabel)}\n v-slots={\n {\n // eslint-disable-next-line max-statements\n default: () => {\n\n const slots: any = {}\n const errData = this.form.errData || '-'\n const resultVal = dataTransformRod(getSpanValue(this.form.model[item.key], item), errData)\n let componentResult = <span class={[resultVal === errData ? 'empty-value' : '']}>{resultVal}</span>\n\n if (this.$slots[formItemSlot(item.key)]) {\n componentResult = (this.$slots[formItemSlot(item.key)]?.({...item, model: this.form.model}))\n } else if (itemShowLabel || (formShowLabel && [true, undefined].includes(itemShowLabel))) {\n return componentResult\n } else if (['input', 'textarea'].includes(item.type)) {\n renderSlot(['prefix', 'suffix', 'prepend', 'append'], this, slots, item)\n componentResult = (<CustomInput form={this.form} formItem={item} v-slots={slots} onEnterSearch={() => {\n this.$emit('SearchFn')}}\n ref={el => this.setFormTypeRefs(item.key, el)}></CustomInput>)\n } else if (['input-number'].includes(item.type)) {\n renderSlot(['decrease-icon', 'increase-icon'], this, slots, item)\n componentResult = (<CustomInputNumber form={this.form} formItem={item} v-slots={slots}\n ref={el => this.setFormTypeRefs(item.key, el)}></CustomInputNumber>)\n } else if (['input-autocomplete'].includes(item.type)) {\n renderSlot(['prefix', 'suffix', 'prepend', 'append', 'loading'], this, slots, item)\n componentResult = (<CustomInputAutocomplete form={this.form} formItem={item} v-slots={slots}\n ref={el => this.setFormTypeRefs(item.key, el)}></CustomInputAutocomplete>)\n } else if (['select'].includes(item.type)) {\n renderSlot(['header', 'footer', 'prefix', 'empty', 'tag', 'loading', 'label'], this, slots, item)\n componentResult = (<CustomSelect form={this.form} formItem={item} v-slots={slots}\n ref={el => this.setFormTypeRefs(item.key, el)}></CustomSelect>)\n } else if (['select-v2'].includes(item.type)) {\n renderSlot(['header', 'footer', 'prefix', 'empty', 'tag', 'loading', 'label'], this, slots, item)\n componentResult = (<CustomSelectV2 form={this.form} formItem={item} v-slots={slots}\n ref={el => this.setFormTypeRefs(item.key, el)}></CustomSelectV2>)\n } else if (['switch'].includes(item.type)) {\n renderSlot(['active-action', 'inactive-action'], this, slots, item)\n componentResult = (<CustomSwitch form={this.form} formItem={item} v-slots={slots}\n ref={el => this.setFormTypeRefs(item.key, el)}></CustomSwitch>)\n } else if ([\n 'datetime',\n 'date',\n 'dates',\n 'week',\n 'month',\n 'year',\n 'years',\n 'datetimerange',\n 'daterange',\n 'monthrange',\n 'yearrange',\n ].includes(item.type)) {\n renderSlot(['range-separator', 'prev-month', 'next-month', 'prev-year', 'next-year'], this, slots, item)\n componentResult = (<CustomDate form={this.form} formItem={item} v-slots={slots}\n ref={el => this.setFormTypeRefs(item.key, el)}></CustomDate>)\n } else if (['radio', 'radio-button'].includes(item.type)) {\n componentResult = (<CustomRadio form={this.form} formItem={item} v-slots={slots}\n ref={el => this.setFormTypeRefs(item.key, el)}></CustomRadio>)\n } else if (['tree-select'].includes(item.type)) {\n renderSlot(['header', 'footer', 'prefix', 'empty', 'tag', 'loading', 'label'], this, slots, item)\n componentResult = (<CustomSelectTree form={this.form} formItem={item} v-slots={slots}\n ref={el => this.setFormTypeRefs(item.key, el)}></CustomSelectTree>)\n } else if (['rate'].includes(item.type)) {\n componentResult = (<CustomRate form={this.form} formItem={item} v-slots={slots}\n ref={el => this.setFormTypeRefs(item.key, el)}></CustomRate>)\n } else if (['checkbox', 'checkbox-button'].includes(item.type)) {\n componentResult = (<CustomCheckbox form={this.form} formItem={item} v-slots={slots}\n ref={el => this.setFormTypeRefs(item.key, el)}></CustomCheckbox>)\n } else if (['cascader'].includes(item.type)) {\n renderSlot(['empty'], this, slots, item)\n componentResult = (<CustomCascader ref={el => this.setFormTypeRefs(item.key, el)}\n form={this.form} formItem={item} v-slots={slots}></CustomCascader>)\n } else if (['slider'].includes(item.type)) {\n componentResult = (<CustomSlider ref={el => this.setFormTypeRefs(item.key, el)}\n form={this.form} formItem={item} v-slots={slots}></CustomSlider>)\n } else if (['time-picker'].includes(item.type)) {\n componentResult = (<CustomTimePicker ref={el => this.setFormTypeRefs(item.key, el)}\n form={this.form} formItem={item} v-slots={slots}></CustomTimePicker>)\n } else if (['time-select'].includes(item.type)) {\n componentResult = (<CustomTimeSelect ref={el => this.setFormTypeRefs(item.key, el)}\n form={this.form} formItem={item} v-slots={slots}></CustomTimeSelect>)\n }\n\n return componentResult\n },\n defaultAfter: () => this.$slots[formItemSlot('after_' + item.key)]?.({...item, model: this.form.model}),\n defaultBefore: () => this.$slots[formItemSlot('before_' + item.key)]?.({...item, model: this.form.model}),\n }\n }\n >\n </dinert-tooltip>\n )\n }\n }}\n >\n </el-form-item>\n </el-col>\n )\n }\n\n })\n }\n </el-row>\n {\n this.search\n && <el-row class={['dinert-form-right', this.isArrow ? 'isArrow' : '']}>\n {this.isArrow\n && <el-button class=\"dinert-form-right-operation\" text type=\"primary\"\n onClick={this.unfold}\n >\n <el-icon>\n {this.packUp ? <ArrowUp/> : <ArrowDown/>}\n </el-icon>\n {this.packUp ? '收起' : '展开'}\n </el-button>\n }\n {this.$slots.form_search?.()\n || (\n <>\n <el-button type=\"primary\" onClick={() => this.$emit('SearchFn')} {...this.form.searchButton}>{this.form.searchButton?.message || '搜索'}</el-button>\n <el-button type=\"primary\" plain\n onClick={() => this.$emit('ResetFn')}\n {...this.form.resetButton}\n >{this.form.resetButton?.message || '重置'}</el-button>\n </>\n )\n }\n </el-row>\n }\n {\n this.$slots.form_search_operations\n && <el-row class={'el-form-right-after'}>\n {this.$slots.form_search_operations?.()}\n </el-row>\n }\n </el-form>\n )\n }\n})\n"],"names":["_isSlot","s","Object","prototype","toString","call","_isVNode","defineComponent","name","props","form","type","default","search","Boolean","emits","setup","emit","toRefs","packUp","ref","value","undefined","isArrow","formRef","formTypeRef","setFormTypeRefs","el","formClass","getUuid","onBeforeUpdate","formItemMap","computed","result","keys","formItem","forEach","key","push","sort","a","b","Infinity","resizeForm","elFormLeft","document","querySelectorAll","nextTick","firstTop","getBoundingClientRect","top","lastTop","length","useWindowResize","unfold","render","_slot","_createVNode","_resolveComponent","_mergeProps","withModifiers","row","map","item","style","vif","model","show","options","placeholder","customPlaceholder","label","display","formShowLabel","showLabel","itemShowLabel","required","rules","trigger","message","concat","valDisabled","itemValueDisabled","tempValueDisabled","colLayout","labelWrap","$slots","formItemSlot","_b","_a","labelDisabled","e","labelMouseEnter","String","getTooltipValue","valueMouseEnter","slots","errData","resultVal","dataTransformRod","getSpanValue","componentResult","includes","renderSlot","CustomInput","onEnterSearch","$emit","CustomInputNumber","CustomInputAutocomplete","CustomSelect","CustomSelectV2","CustomSwitch","CustomDate","CustomRadio","CustomSelectTree","CustomRate","CustomCheckbox","CustomCascader","CustomSlider","CustomTimePicker","CustomTimeSelect","defaultAfter","defaultBefore","ArrowUp","ArrowDown","form_search","_Fragment","onClick","searchButton","resetButton","form_search_operations"],"mappings":";;;;;;;;;;;;;;;;;;;;;AA0B+C,SAAAA,GAAAC,GAAA;AAAA,SAAA,OAAAA,KAAA,cAAAC,OAAAC,UAAAC,SAAAC,KAAAJ,CAAA,MAAAK,qBAAAA,CAAAA,EAAAL,CAAA;AAAA;AAM/C,MAAeM,uBAAgB;AAAA,EAC3BC,MAAM;AAAA,EACNC,OAAO;AAAA,IACHC,MAAM;AAAA,MACFC,MAAMT;AAAAA,MACNU,SAASA,OAAO,CAAA;AAAA,IACnB;AAAA,IACDC,QAAQ;AAAA,MACJF,MAAMG;AAAAA,MACNF,SAAS;AAAA,IACb;AAAA,EACH;AAAA,EACDG,OAAO,CAAC,UAAU,YAA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,OAC5B;AAAA,MAAqB,GAAA;AAAA,QAAA9C,SAAAA,MAAAA;;AAClC,mBAAA4E,KAAAC,IAAA,KAAKH,QAAO4C,2BAAZ,gBAAA1C,EAAA,KAAAC,EAAsC;AAAA;AAAA,OAClC,CAAA;AAAA,IAAA,CAAA;AAAA,EAIb;AACJ,CAAC;"}
1
+ {"version":3,"file":"index.mjs","sources":["../../../../../packages/components/form/src/index.tsx"],"sourcesContent":["import {defineComponent, ref, computed, nextTick, toRefs, onBeforeUpdate, withModifiers} from 'vue'\nimport CustomInput from './input'\nimport CustomInputNumber from './input-number'\nimport CustomInputAutocomplete from './input-autocomplete'\nimport CustomSelect from './select'\nimport CustomSelectV2 from './select-v2'\nimport CustomSwitch from './switch'\nimport CustomDate from './date'\nimport CustomRadio from './radio'\nimport CustomSelectTree from './tree-select'\nimport CustomRate from './rate'\nimport CustomCheckbox from './checkbox'\nimport CustomCascader from './cascader'\nimport CustomSlider from './slider'\nimport CustomTimePicker from './time-picker'\nimport CustomTimeSelect from './time-select'\n\nimport useWindowResize from '@packages/hooks/useWindowResize'\nimport {labelMouseEnter, valueMouseEnter, getTooltipValue, getSpanValue, formItemSlot, customPlaceholder, renderSlot} from '@packages/components/form/utils'\n\nimport {dataTransformRod, getUuid} from '@packages/utils/tools'\nimport {ElForm} from 'element-plus'\n\nimport {ArrowUp, ArrowDown} from '@element-plus/icons-vue'\n\n\nimport '@packages/assets/scss/dinert-form.scss'\n\nimport type {PropType} from 'vue'\nimport type {RewriteFormProps, CustomFormItemProps} from '@packages/components/form/types'\n\n// 展开还是收起状态\nexport default defineComponent({\n name: 'dinert-form',\n props: {\n form: {\n type: Object as PropType<RewriteFormProps>,\n default: () => ({})\n },\n search: {\n type: Boolean,\n default: true\n }\n },\n emits: ['UnFold', 'SearchFn', 'ResetFn'],\n setup(props, {emit}) {\n const {form} = toRefs(props)\n const packUp = ref(form.value.packUp === undefined)\n const isArrow = ref(false)\n const formRef = ref<InstanceType<typeof ElForm>>()\n const formTypeRef = ref<any>({})\n const setFormTypeRefs = (type: string, el: any) => {\n formTypeRef.value[type] = el\n }\n const formClass = ref('form_' + getUuid())\n\n onBeforeUpdate(() => {\n formTypeRef.value = {}\n })\n\n const formItemMap = computed(() => {\n const result: any = []\n Object.keys(form.value.formItem).forEach(key => {\n const value = form.value.formItem[key] as Partial<CustomFormItemProps>\n result.push({\n ...value,\n key: key,\n })\n })\n\n result.sort((a: any, b: any) => {\n return (a.sort || Infinity) - (b.sort || Infinity)\n })\n\n return result\n })\n\n const resizeForm = () => {\n let elFormLeft = document.querySelectorAll(`.${formClass.value} .dinert-form-left > div`) as any\n if (elFormLeft[0]) {\n isArrow.value = false\n nextTick(() => {\n const firstTop = elFormLeft[0].getBoundingClientRect().top\n const lastTop = elFormLeft[elFormLeft.length - 1].getBoundingClientRect().top\n const isHeight = firstTop !== lastTop\n if (isHeight) {\n isArrow.value = true\n } else {\n if (!packUp.value) {\n packUp.value = true\n }\n isArrow.value = false\n }\n elFormLeft = null\n })\n\n }\n }\n\n useWindowResize(() => {\n resizeForm()\n }, 100, true)\n\n\n const unfold = () => {\n if (packUp.value) {\n packUp.value = false\n } else {\n packUp.value = true\n }\n\n emit('UnFold', packUp.value)\n }\n\n\n return {\n formItemMap,\n formClass,\n formTypeRef,\n formRef,\n packUp,\n isArrow,\n\n setFormTypeRefs,\n unfold,\n }\n },\n render() {\n return (\n <el-form inline={true}\n {...this.form}\n ref={el => {this.formRef = el}}\n class={[this.formClass, this.packUp ? '' : 'packUp', 'dinert-form']}\n onSubmit={withModifiers(() => undefined, ['stop', 'prevent'])}\n key={this.form.key}>\n\n <el-row {...this.form.row} class=\"dinert-form-left\">\n {/* eslint-disable-next-line array-callback-return, consistent-return */}\n { this.formItemMap.map((item: CustomFormItemProps) => {\n const style: any = {}\n let vif = typeof item.vif === 'function' ? item.vif(this.form.model) : item.vif\n vif = vif === undefined ? typeof this.form.vif === 'function' ? this.form.vif(this.form.model) : vif : vif\n vif = vif === undefined ? true : vif\n\n let show = typeof item.show === 'function' ? item.show(this.form.model) : item.show\n show = show === undefined ? true : show\n item.options = {placeholder: customPlaceholder(typeof item.label === 'function' ? item.label(this.form.model) : item.label, item.type), ...item.options}\n\n\n if (!show) {\n style.display = 'none'\n }\n if (vif) {\n const formShowLabel = typeof this.form.showLabel === 'function' ? this.form.showLabel(this.form.model) : this.form.showLabel\n let itemShowLabel = typeof item.showLabel === 'function' ? item.showLabel(this.form.model) : item.showLabel\n item.required = item.required === undefined ? item.required || this.form.required : item.required\n itemShowLabel = itemShowLabel === undefined ? itemShowLabel || formShowLabel : itemShowLabel\n item.required = itemShowLabel ? false : item.required\n\n let rules = item.rules || []\n rules = item.required ? [{required: true, trigger: ['blur', 'change'], message: customPlaceholder(typeof item.label === 'function' ? item.label(this.form.model) : item.label, item.type)}].concat(rules as any) : rules\n rules = itemShowLabel ? [] : rules\n const valDisabled = item.itemValueDisabled !== undefined ? item.itemValueDisabled : item.tempValueDisabled\n\n return (\n <el-col\n style= {style}\n class={[item.type, item.key]}\n key={item.key}\n {\n ...{\n // xl: 3, // ≥1920px\n // lg: 4, // ≥1200px\n // md: 8, // ≥992px\n // sm: 12, // ≥768px\n // xs: 24, // <768px\n ...this.form.colLayout,\n ...item.colLayout\n }\n }\n >\n <el-form-item\n key={item.key}\n prop={item.key}\n class={[item.labelWrap ? 'label-wrap' : '', itemShowLabel ? 'show-label' : '']}\n {...{\n ...item,\n label: typeof item.label === 'function' ? item.label(this.form.model) : item.label,\n rules: rules\n }}\n v-slots={{\n label: () => {\n if (this.$slots[formItemSlot(item.key, 'formItem_label_')]) {\n return (this.$slots[formItemSlot(item.key, 'formItem_label_')]?.({...item, model: this.form.model}))\n }\n return (\n <dinert-tooltip\n key={item.key}\n content={typeof item.label === 'function' ? item.label(this.form.model) : item.label}\n disabled={item.labelDisabled}\n onLabelMouseEnter={(e: MouseEvent) => {labelMouseEnter(e, item, this)}}\n >\n </dinert-tooltip>\n )\n },\n default: () => {\n return (\n <dinert-tooltip\n key={item.key}\n content={String(getTooltipValue(this.form.model[item.key], item))}\n disabled={valDisabled}\n item={item}\n onLabelMouseEnter={(e: MouseEvent) => valueMouseEnter(e, item, this.form.model[item.key], this, itemShowLabel)}\n v-slots={\n {\n // eslint-disable-next-line max-statements\n default: () => {\n\n const slots: any = {}\n const errData = this.form.errData || '-'\n const resultVal = dataTransformRod(getSpanValue(this.form.model[item.key], item), errData)\n let componentResult = <span class={[resultVal === errData ? 'empty-value' : '']}>{resultVal}</span>\n\n if (this.$slots[formItemSlot(item.key)]) {\n componentResult = (this.$slots[formItemSlot(item.key)]?.({...item, model: this.form.model}))\n } else if (itemShowLabel || (formShowLabel && [true, undefined].includes(itemShowLabel))) {\n return componentResult\n } else if (['input', 'textarea'].includes(item.type)) {\n renderSlot(['prefix', 'suffix', 'prepend', 'append'], this, slots, item)\n componentResult = (<CustomInput form={this.form} formItem={item} v-slots={slots} onEnterSearch={() => {\n this.$emit('SearchFn')}}\n ref={el => this.setFormTypeRefs(item.key, el)}></CustomInput>)\n } else if (['input-number'].includes(item.type)) {\n renderSlot(['decrease-icon', 'increase-icon', 'prefix', 'suffix'], this, slots, item)\n componentResult = (<CustomInputNumber form={this.form} formItem={item} v-slots={slots}\n ref={el => this.setFormTypeRefs(item.key, el)}></CustomInputNumber>)\n } else if (['input-autocomplete'].includes(item.type)) {\n renderSlot(['prefix', 'suffix', 'prepend', 'append', 'loading'], this, slots, item)\n componentResult = (<CustomInputAutocomplete form={this.form} formItem={item} v-slots={slots}\n ref={el => this.setFormTypeRefs(item.key, el)}></CustomInputAutocomplete>)\n } else if (['select'].includes(item.type)) {\n renderSlot(['header', 'footer', 'prefix', 'empty', 'tag', 'loading', 'label'], this, slots, item)\n componentResult = (<CustomSelect form={this.form} formItem={item} v-slots={slots}\n ref={el => this.setFormTypeRefs(item.key, el)}></CustomSelect>)\n } else if (['select-v2'].includes(item.type)) {\n renderSlot(['header', 'footer', 'prefix', 'empty', 'tag', 'loading', 'label'], this, slots, item)\n componentResult = (<CustomSelectV2 form={this.form} formItem={item} v-slots={slots}\n ref={el => this.setFormTypeRefs(item.key, el)}></CustomSelectV2>)\n } else if (['switch'].includes(item.type)) {\n renderSlot(['active-action', 'inactive-action'], this, slots, item)\n componentResult = (<CustomSwitch form={this.form} formItem={item} v-slots={slots}\n ref={el => this.setFormTypeRefs(item.key, el)}></CustomSwitch>)\n } else if ([\n 'datetime',\n 'date',\n 'dates',\n 'week',\n 'month',\n 'year',\n 'years',\n 'datetimerange',\n 'daterange',\n 'monthrange',\n 'yearrange',\n ].includes(item.type)) {\n renderSlot(['range-separator', 'prev-month', 'next-month', 'prev-year', 'next-year'], this, slots, item)\n componentResult = (<CustomDate form={this.form} formItem={item} v-slots={slots}\n ref={el => this.setFormTypeRefs(item.key, el)}></CustomDate>)\n } else if (['radio', 'radio-button'].includes(item.type)) {\n componentResult = (<CustomRadio form={this.form} formItem={item} v-slots={slots}\n ref={el => this.setFormTypeRefs(item.key, el)}></CustomRadio>)\n } else if (['tree-select'].includes(item.type)) {\n renderSlot(['header', 'footer', 'prefix', 'empty', 'tag', 'loading', 'label'], this, slots, item)\n componentResult = (<CustomSelectTree form={this.form} formItem={item} v-slots={slots}\n ref={el => this.setFormTypeRefs(item.key, el)}></CustomSelectTree>)\n } else if (['rate'].includes(item.type)) {\n componentResult = (<CustomRate form={this.form} formItem={item} v-slots={slots}\n ref={el => this.setFormTypeRefs(item.key, el)}></CustomRate>)\n } else if (['checkbox', 'checkbox-button'].includes(item.type)) {\n componentResult = (<CustomCheckbox form={this.form} formItem={item} v-slots={slots}\n ref={el => this.setFormTypeRefs(item.key, el)}></CustomCheckbox>)\n } else if (['cascader'].includes(item.type)) {\n renderSlot(['empty'], this, slots, item)\n componentResult = (<CustomCascader ref={el => this.setFormTypeRefs(item.key, el)}\n form={this.form} formItem={item} v-slots={slots}></CustomCascader>)\n } else if (['slider'].includes(item.type)) {\n componentResult = (<CustomSlider ref={el => this.setFormTypeRefs(item.key, el)}\n form={this.form} formItem={item} v-slots={slots}></CustomSlider>)\n } else if (['time-picker'].includes(item.type)) {\n componentResult = (<CustomTimePicker ref={el => this.setFormTypeRefs(item.key, el)}\n form={this.form} formItem={item} v-slots={slots}></CustomTimePicker>)\n } else if (['time-select'].includes(item.type)) {\n componentResult = (<CustomTimeSelect ref={el => this.setFormTypeRefs(item.key, el)}\n form={this.form} formItem={item} v-slots={slots}></CustomTimeSelect>)\n }\n\n return componentResult\n },\n defaultAfter: () => this.$slots[formItemSlot('after_' + item.key)]?.({...item, model: this.form.model}),\n defaultBefore: () => this.$slots[formItemSlot('before_' + item.key)]?.({...item, model: this.form.model}),\n }\n }\n >\n </dinert-tooltip>\n )\n }\n }}\n >\n </el-form-item>\n </el-col>\n )\n }\n\n })\n }\n </el-row>\n {\n this.search\n && <el-row class={['dinert-form-right', this.isArrow ? 'isArrow' : '']}>\n {this.isArrow\n && <el-button class=\"dinert-form-right-operation\" text type=\"primary\"\n onClick={this.unfold}\n >\n <el-icon>\n {this.packUp ? <ArrowUp/> : <ArrowDown/>}\n </el-icon>\n {this.packUp ? '收起' : '展开'}\n </el-button>\n }\n {this.$slots.form_search?.()\n || (\n <>\n <el-button type=\"primary\" onClick={() => this.$emit('SearchFn')} {...this.form.searchButton}>{this.form.searchButton?.message || '搜索'}</el-button>\n <el-button type=\"primary\" plain\n onClick={() => this.$emit('ResetFn')}\n {...this.form.resetButton}\n >{this.form.resetButton?.message || '重置'}</el-button>\n </>\n )\n }\n </el-row>\n }\n {\n this.$slots.form_search_operations\n && <el-row class={'el-form-right-after'}>\n {this.$slots.form_search_operations?.()}\n </el-row>\n }\n </el-form>\n )\n }\n})\n"],"names":["_isSlot","s","Object","prototype","toString","call","_isVNode","defineComponent","name","props","form","type","default","search","Boolean","emits","setup","emit","toRefs","packUp","ref","value","undefined","isArrow","formRef","formTypeRef","setFormTypeRefs","el","formClass","getUuid","onBeforeUpdate","formItemMap","computed","result","keys","formItem","forEach","key","push","sort","a","b","Infinity","resizeForm","elFormLeft","document","querySelectorAll","nextTick","firstTop","getBoundingClientRect","top","lastTop","length","useWindowResize","unfold","render","_slot","_createVNode","_resolveComponent","_mergeProps","withModifiers","row","map","item","style","vif","model","show","options","placeholder","customPlaceholder","label","display","formShowLabel","showLabel","itemShowLabel","required","rules","trigger","message","concat","valDisabled","itemValueDisabled","tempValueDisabled","colLayout","labelWrap","$slots","formItemSlot","_b","_a","labelDisabled","e","labelMouseEnter","String","getTooltipValue","valueMouseEnter","slots","errData","resultVal","dataTransformRod","getSpanValue","componentResult","includes","renderSlot","CustomInput","onEnterSearch","$emit","CustomInputNumber","CustomInputAutocomplete","CustomSelect","CustomSelectV2","CustomSwitch","CustomDate","CustomRadio","CustomSelectTree","CustomRate","CustomCheckbox","CustomCascader","CustomSlider","CustomTimePicker","CustomTimeSelect","defaultAfter","defaultBefore","ArrowUp","ArrowDown","form_search","_Fragment","onClick","searchButton","resetButton","form_search_operations"],"mappings":";;;;;;;;;;;;;;;;;;;;;AA0B+C,SAAAA,GAAAC,GAAA;AAAA,SAAA,OAAAA,KAAA,cAAAC,OAAAC,UAAAC,SAAAC,KAAAJ,CAAA,MAAAK,qBAAAA,CAAAA,EAAAL,CAAA;AAAA;AAM/C,MAAeM,uBAAgB;AAAA,EAC3BC,MAAM;AAAA,EACNC,OAAO;AAAA,IACHC,MAAM;AAAA,MACFC,MAAMT;AAAAA,MACNU,SAASA,OAAO,CAAA;AAAA,IACnB;AAAA,IACDC,QAAQ;AAAA,MACJF,MAAMG;AAAAA,MACNF,SAAS;AAAA,IACb;AAAA,EACH;AAAA,EACDG,OAAO,CAAC,UAAU,YAAY,SAAS;AAAA,EACvCC,MAAMP,GAAO;AAAA,IAACQ,MAAAA;AAAAA,EAAI,GAAG;AACjB,UAAM;AAAA,MAACP,MAAAA;AAAAA,IAAI,IAAIQ,EAAOT,CAAK,GACrBU,IAASC,EAAIV,EAAKW,MAAMF,WAAWG,MAAS,GAC5CC,IAAUH,EAAI,EAAK,GACnBI,IAAU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 -1,37 +1,37 @@
1
1
  import { isSlotsValue as y } from "../../../utils/tools.mjs";
2
2
  const h = (t, l, r) => {
3
- const e = t.target.parentElement.parentElement, n = window.getComputedStyle(e, null), i = l.rules ? 12 : l.beforeWidth || 0, o = parseInt(n.getPropertyValue("max-width")) - i - parseInt(n.getPropertyValue("padding-right"));
3
+ const e = t.target.parentElement.parentElement, n = window.getComputedStyle(e, null), s = l.rules ? 12 : l.beforeWidth || 0, o = parseInt(n.getPropertyValue("max-width")) - s - parseInt(n.getPropertyValue("padding-right"));
4
4
  t.target.previousElementSibling.offsetWidth >= o ? r.form.formItem[l.key].labelDisabled = !1 : r.form.formItem[l.key].labelDisabled = !0;
5
5
  }, d = (t, l, r) => {
6
6
  const e = [];
7
- function n(i) {
8
- i.forEach((o) => {
7
+ function n(s) {
8
+ s.forEach((o) => {
9
9
  o && ((Array.isArray(r) && r.includes(o[l]) || r === o[l]) && e.push(o), o.children && o.children.length && n(o.children));
10
10
  });
11
11
  }
12
12
  return n(t), e;
13
13
  }, E = (t, l) => {
14
- var i, o, s, a;
14
+ var s, o, p, a;
15
15
  const r = l.type, e = l.options || {}, n = [];
16
16
  if (["input", "input-autocomplete", "input-number"].includes(r))
17
17
  return t;
18
18
  if (["select", "tree-select", "select-v2"].includes(r)) {
19
19
  if (e && e.options && e.options.length) {
20
- let p = null, c = ["select-v2"].includes(r) ? e.props && e.props.value : e.value;
20
+ let i = null, c = ["select-v2"].includes(r) ? e.props && e.props.value : e.value;
21
21
  c = c || "value";
22
22
  let u = ["select-v2"].includes(r) ? e.props && e.props.label : e.label;
23
- return u = u || "label", e.valueKey && (p = t && t[e.valueKey]), d(e.options, e.value === "object" ? e.valueKey : c, p || t).forEach((f) => {
23
+ return u = u || "label", e.valueKey && (i = t && t[e.valueKey]), d(e.options, e.value === "object" ? e.valueKey : c, i || t).forEach((f) => {
24
24
  n.push(f[u]);
25
25
  }), n && n.length ? n.join(",") : t;
26
26
  }
27
27
  } else if (["cascader"].includes(r) && e && e.options && e.options.length) {
28
- (((i = e.props) == null ? void 0 : i.emitPath) === void 0 || ((o = e.props) == null ? void 0 : o.emitPath) === !0) && (t = t && t[0]);
29
- const p = d(e.options, ((s = e.props) == null ? void 0 : s.value) || "value", t)[0];
30
- return p && p[((a = e.props) == null ? void 0 : a.label) || "label"];
28
+ (((s = e.props) == null ? void 0 : s.emitPath) === void 0 || ((o = e.props) == null ? void 0 : o.emitPath) === !0) && (t = t && t[0]);
29
+ const i = d(e.options, ((p = e.props) == null ? void 0 : p.value) || "value", t)[0];
30
+ return i && i[((a = e.props) == null ? void 0 : a.label) || "label"];
31
31
  }
32
32
  return null;
33
33
  }, I = (t, l) => {
34
- var i, o, s, a;
34
+ var s, o, p, a;
35
35
  const r = l.type, e = l.options || {}, n = [];
36
36
  if ([
37
37
  "input",
@@ -53,17 +53,17 @@ const h = (t, l, r) => {
53
53
  return t;
54
54
  if (["select", "tree-select", "select-v2", "radio", "radio-button", "checkbox", "checkbox-button"].includes(r)) {
55
55
  if (e && e.options && e.options.length) {
56
- let p = null, c = ["select-v2"].includes(r) ? e.props && e.props.value : e.value;
56
+ let i = null, c = ["select-v2"].includes(r) ? e.props && e.props.value : e.value;
57
57
  c = c || "value";
58
58
  let u = ["select-v2"].includes(r) ? e.props && e.props.label : e.label;
59
- return u = u || "label", e.valueKey && (p = t && t[e.valueKey]), d(e.options, e.value === "object" ? e.valueKey : c, p || t).forEach((f) => {
59
+ return u = u || "label", e.valueKey && (i = t && t[e.valueKey]), d(e.options, e.value === "object" ? e.valueKey : c, i || t).forEach((f) => {
60
60
  n.push(f[u]);
61
61
  }), n && n.length ? n.join(",") : t;
62
62
  }
63
63
  } else if (["cascader"].includes(r) && e && e.options && e.options.length) {
64
- (((i = e.props) == null ? void 0 : i.emitPath) === void 0 || ((o = e.props) == null ? void 0 : o.emitPath) === !0) && (t = t && t[0]);
65
- const p = d(e.options, ((s = e.props) == null ? void 0 : s.value) || "value", t)[0];
66
- return p && p[((a = e.props) == null ? void 0 : a.label) || "label"];
64
+ (((s = e.props) == null ? void 0 : s.emitPath) === void 0 || ((o = e.props) == null ? void 0 : o.emitPath) === !0) && (t = t && t[0]);
65
+ const i = d(e.options, ((p = e.props) == null ? void 0 : p.value) || "value", t)[0];
66
+ return i && i[((a = e.props) == null ? void 0 : a.label) || "label"];
67
67
  }
68
68
  return null;
69
69
  }, V = (t, l, r, e, n) => {
@@ -73,11 +73,11 @@ const h = (t, l, r) => {
73
73
  }
74
74
  let o = null;
75
75
  if (n ? o = t.target : ["input", "input-autocomplete", "cascader", "input-number"].includes(l.type) ? o = t.target.parentElement.querySelector(".el-input__inner") || t.target.parentElement.querySelector(".busy-input__inner") : ["select", "tree-select", "select-v2"].includes(l.type) && (o = t.target.parentElement.querySelector(".el-select__selected-item.el-select__placeholder") || t.target.parentElement.querySelector(".busy-select__selected-item.el-select__placeholder"), o = o || t.target.parentElement.querySelector(".el-select__selection") || t.target.parentElement.querySelector(".busy-select__selection")), o) {
76
- const s = window.getComputedStyle(o, null), a = o.offsetWidth - parseInt(s.getPropertyValue("padding-right")) - parseInt(s.getPropertyValue("padding-left"));
76
+ const p = window.getComputedStyle(o, null), a = o.offsetWidth - parseInt(p.getPropertyValue("padding-right")) - parseInt(p.getPropertyValue("padding-left"));
77
77
  t.target.previousElementSibling.offsetWidth >= a ? e.form.formItem[l.key].tempValueDisabled = !1 : e.form.formItem[l.key].tempValueDisabled = !0;
78
78
  } else
79
79
  e.form.formItem[l.key].tempValueDisabled = !0;
80
- }, _ = (t, l = "input", r = "请输入") => (r = [
80
+ }, v = (t, l = "input", r = "请输入") => (r = [
81
81
  "select",
82
82
  "tree-select",
83
83
  "cascader",
@@ -95,24 +95,22 @@ const h = (t, l, r) => {
95
95
  "time-picker",
96
96
  "radio",
97
97
  "radio-button"
98
- ].includes(l) ? "请选择" : r, r + (t || "")), b = (t, l = "formItem_") => l + (t || ""), v = (t = [], l, r, e) => {
99
- var n, i;
98
+ ].includes(l) ? "请选择" : r, r + (t || "")), b = (t, l = "formItem_") => l + (t || ""), _ = (t = [], l, r, e) => {
99
+ var n, s;
100
100
  for (const o in l.$slots) {
101
- const s = o.split("formItem_").join("").split("_")[1];
101
+ const p = o.split("_");
102
102
  let a = null;
103
- if (!s)
104
- return;
105
- t.includes(s) && b(e.key) + "_" + s === o && (a = (i = (n = l.$slots)[o]) == null ? void 0 : i.call(n, e), y(a) && (r[s] = () => a));
103
+ t.includes(p[2]) && b(e.key) + "_" + p[2] === o && (a = (s = (n = l.$slots)[o]) == null ? void 0 : s.call(n, e), y(a) && (r[p[2]] = () => a));
106
104
  }
107
105
  };
108
106
  export {
109
- _ as customPlaceholder,
107
+ v as customPlaceholder,
110
108
  d as findTreeNode,
111
109
  b as formItemSlot,
112
110
  I as getSpanValue,
113
111
  E as getTooltipValue,
114
112
  h as labelMouseEnter,
115
- v as renderSlot,
113
+ _ as renderSlot,
116
114
  V as valueMouseEnter
117
115
  };
118
116
  //# sourceMappingURL=index.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.mjs","sources":["../../../../../packages/components/form/utils/index.ts"],"sourcesContent":["import {isSlotsValue} from '@packages/utils/tools'\n\nexport const labelMouseEnter = (e: MouseEvent, item: any, _this: any) => {\n const el = (e.target as any).parentElement.parentElement\n const labelEl = window.getComputedStyle(el, null)\n const isRequried = item.rules ? 12 : item.beforeWidth || 0\n const labelWidth\n = parseInt(labelEl.getPropertyValue('max-width')) - isRequried\n - parseInt(labelEl.getPropertyValue('padding-right'))\n const tooltipWidth = (e.target as any).previousElementSibling.offsetWidth\n if (tooltipWidth >= labelWidth) {\n _this.form.formItem[item.key].labelDisabled = false\n\n } else {\n _this.form.formItem[item.key].labelDisabled = true\n }\n}\n\nexport const findTreeNode = (treeData: any, key: string, value: string) => {\n const result: any[] = []\n function filterResult(treeData: any) {\n treeData.forEach((item: any) => {\n if (item) {\n if ((Array.isArray(value) && value.includes(item[key])) || value === item[key]) {\n result.push(item)\n }\n if (item.children && item.children.length) {\n filterResult(item.children)\n }\n }\n\n })\n }\n filterResult(treeData)\n return result\n}\n\n\nexport const getTooltipValue = (value: any, item: any): any => {\n const type = item.type\n const options = item.options || {}\n const tempArr: string[] = []\n if (['input', 'input-autocomplete', 'input-number'].includes(type)) {\n return value\n } else if (['select', 'tree-select', 'select-v2'].includes(type)) {\n if (options && options.options && options.options.length) {\n let newVal = null\n\n let optValue = ['select-v2'].includes(type) ? options.props && options.props.value : options.value\n optValue = optValue || 'value'\n let optLabel = ['select-v2'].includes(type) ? options.props && options.props.label : options.label\n optLabel = optLabel || 'label'\n\n if (options.valueKey) {\n newVal = value && value[options.valueKey]\n }\n const selectItem = findTreeNode(options.options, options.value === 'object' ? options.valueKey : optValue, newVal || value)\n selectItem.forEach(item => {\n tempArr.push(item[optLabel])\n })\n if (tempArr && tempArr.length) {\n return tempArr.join(',')\n }\n return value\n }\n } else if (['cascader'].includes(type)) {\n if (options && options.options && options.options.length) {\n if (options.props?.emitPath === undefined || options.props?.emitPath === true) {\n value = value && value[0]\n }\n\n const selectItem = findTreeNode(options.options, options.props?.value || 'value', value)[0]\n return selectItem && selectItem[options.props?.label || 'label']\n }\n }\n return null\n}\n\nexport const getSpanValue = (value: any, item: any): any => {\n const type = item.type\n const options = item.options || {}\n const tempArr: string[] = []\n\n\n if (['input', 'input-autocomplete', 'input-number', 'textarea', 'datetime',\n 'date',\n 'dates',\n 'week',\n 'month',\n 'year',\n 'years',\n 'datetimerange',\n 'daterange',\n 'monthrange',\n 'yearrange',].includes(type)) {\n return value\n } else if (['select', 'tree-select', 'select-v2', 'radio', 'radio-button', 'checkbox', 'checkbox-button'].includes(type)) {\n if (options && options.options && options.options.length) {\n let newVal = null\n let optValue = ['select-v2'].includes(type) ? options.props && options.props.value : options.value\n optValue = optValue || 'value'\n let optLabel = ['select-v2'].includes(type) ? options.props && options.props.label : options.label\n optLabel = optLabel || 'label'\n\n if (options.valueKey) {\n newVal = value && value[options.valueKey]\n }\n const selectItem = findTreeNode(options.options, options.value === 'object' ? options.valueKey : optValue, newVal || value)\n selectItem.forEach(item => {\n tempArr.push(item[optLabel])\n })\n if (tempArr && tempArr.length) {\n return tempArr.join(',')\n }\n return value\n }\n } else if (['cascader'].includes(type)) {\n if (options && options.options && options.options.length) {\n if (options.props?.emitPath === undefined || options.props?.emitPath === true) {\n value = value && value[0]\n }\n\n const selectItem = findTreeNode(options.options, options.props?.value || 'value', value)[0]\n return selectItem && selectItem[options.props?.label || 'label']\n }\n }\n return null\n}\n\nexport const valueMouseEnter = (e: MouseEvent, item: any, value: any, _this, itemShowLabel: any) => {\n const showCom = ['input', 'input-autocomplete', 'cascader', 'input-number', 'select', 'tree-select', 'select-v2', 'textarea']\n\n if (!value || (!showCom.includes(item.type) && itemShowLabel !== true)) {\n _this.form.formItem[item.key].tempValueDisabled = true\n return\n }\n let el: HTMLElement | null = null\n if (itemShowLabel) {\n el = e.target as any\n } else if (['input', 'input-autocomplete', 'cascader', 'input-number'].includes(item.type)) {\n el = (e.target as any).parentElement.querySelector('.el-input__inner') || (e.target as any).parentElement.querySelector('.busy-input__inner') as HTMLElement\n } else if (['select', 'tree-select', 'select-v2'].includes(item.type)) {\n el = (e.target as any).parentElement.querySelector('.el-select__selected-item.el-select__placeholder') || (e.target as any).parentElement.querySelector('.busy-select__selected-item.el-select__placeholder') as HTMLElement\n el = el || (e.target as any).parentElement.querySelector('.el-select__selection') || (e.target as any).parentElement.querySelector('.busy-select__selection') as HTMLElement\n }\n\n\n if (el) {\n const inputEl = window.getComputedStyle(el, null)\n const textWidth\n = el.offsetWidth\n - parseInt(inputEl.getPropertyValue('padding-right'))\n - parseInt(inputEl.getPropertyValue('padding-left'))\n const tooltipEl = (e.target as any).previousElementSibling\n const tooltipWidth = tooltipEl.offsetWidth\n\n if (tooltipWidth >= textWidth) {\n _this.form.formItem[item.key].tempValueDisabled = false\n } else {\n _this.form.formItem[item.key].tempValueDisabled = true\n\n }\n } else {\n _this.form.formItem[item.key].tempValueDisabled = true\n }\n\n}\n\nexport const customPlaceholder = (customName: any, type: string = 'input', name: string = '请输入') => {\n name = ['select', 'tree-select', 'cascader', 'select-v2', 'datetime',\n 'datetimerange', 'date', 'daterange', 'dates', 'week', 'month', 'monthrange', 'year', 'years', 'time-picker', 'radio', 'radio-button'].includes(type) ? '请选择' : name\n return name + ((customName) || '')\n}\n\nexport const formItemSlot = (customName: any, name: string = 'formItem_') => {\n return name + (customName || '')\n}\n\n\nexport const renderSlot = (arr: string[] = [], _this: any, slots, item: any): any => {\n for (const prop in _this.$slots) {\n const slotName = prop.split('formItem_').join('').split('_')[1]\n\n let slotFn: any = null\n if (!slotName) {\n return\n }\n\n if (arr.includes(slotName) && formItemSlot(item.key) + '_' + slotName === prop) {\n\n slotFn = _this.$slots[prop]?.(item)\n // eslint-disable-next-line consistent-return\n isSlotsValue(slotFn) && (slots[slotName] = () => slotFn)\n }\n }\n}\n"],"names":["labelMouseEnter","e","item","_this","el","labelEl","isRequried","labelWidth","findTreeNode","treeData","key","value","result","filterResult","getTooltipValue","type","options","tempArr","newVal","optValue","optLabel","_a","_b","selectItem","_c","_d","getSpanValue","valueMouseEnter","itemShowLabel","inputEl","textWidth","customPlaceholder","customName","name","formItemSlot","renderSlot","arr","slots","prop","slotName","slotFn","isSlotsValue"],"mappings":";AAEO,MAAMA,IAAkB,CAACC,GAAeC,GAAWC,MAAe;AAC/D,QAAAC,IAAMH,EAAE,OAAe,cAAc,eACrCI,IAAU,OAAO,iBAAiBD,GAAI,IAAI,GAC1CE,IAAaJ,EAAK,QAAQ,KAAKA,EAAK,eAAe,GACnDK,IACA,SAASF,EAAQ,iBAAiB,WAAW,CAAC,IAAIC,IAC9C,SAASD,EAAQ,iBAAiB,eAAe,CAAC;AAE5D,EADsBJ,EAAE,OAAe,uBAAuB,eAC1CM,IAChBJ,EAAM,KAAK,SAASD,EAAK,GAAG,EAAE,gBAAgB,KAG9CC,EAAM,KAAK,SAASD,EAAK,GAAG,EAAE,gBAAgB;AAEtD,GAEaM,IAAe,CAAC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G,CAAQ,KAAKL,EAAahC,EAAK,GAAG,IAAI,MAAMqC,MAAaD,MAEtEE,KAASlB,KAAAD,IAAAlB,EAAM,QAAOmC,OAAb,gBAAAhB,EAAA,KAAAD,GAAqBnB,IAE9BuC,EAAaD,CAAM,MAAMH,EAAME,CAAQ,IAAI,MAAMC;AAAA,EAEzD;AACJ;"}
1
+ {"version":3,"file":"index.mjs","sources":["../../../../../packages/components/form/utils/index.ts"],"sourcesContent":["import {isSlotsValue} from '@packages/utils/tools'\n\nexport const labelMouseEnter = (e: MouseEvent, item: any, _this: any) => {\n const el = (e.target as any).parentElement.parentElement\n const labelEl = window.getComputedStyle(el, null)\n const isRequried = item.rules ? 12 : item.beforeWidth || 0\n const labelWidth\n = parseInt(labelEl.getPropertyValue('max-width')) - isRequried\n - parseInt(labelEl.getPropertyValue('padding-right'))\n const tooltipWidth = (e.target as any).previousElementSibling.offsetWidth\n if (tooltipWidth >= labelWidth) {\n _this.form.formItem[item.key].labelDisabled = false\n\n } else {\n _this.form.formItem[item.key].labelDisabled = true\n }\n}\n\nexport const findTreeNode = (treeData: any, key: string, value: string) => {\n const result: any[] = []\n function filterResult(treeData: any) {\n treeData.forEach((item: any) => {\n if (item) {\n if ((Array.isArray(value) && value.includes(item[key])) || value === item[key]) {\n result.push(item)\n }\n if (item.children && item.children.length) {\n filterResult(item.children)\n }\n }\n\n })\n }\n filterResult(treeData)\n return result\n}\n\n\nexport const getTooltipValue = (value: any, item: any): any => {\n const type = item.type\n const options = item.options || {}\n const tempArr: string[] = []\n if (['input', 'input-autocomplete', 'input-number'].includes(type)) {\n return value\n } else if (['select', 'tree-select', 'select-v2'].includes(type)) {\n if (options && options.options && options.options.length) {\n let newVal = null\n\n let optValue = ['select-v2'].includes(type) ? options.props && options.props.value : options.value\n optValue = optValue || 'value'\n let optLabel = ['select-v2'].includes(type) ? options.props && options.props.label : options.label\n optLabel = optLabel || 'label'\n\n if (options.valueKey) {\n newVal = value && value[options.valueKey]\n }\n const selectItem = findTreeNode(options.options, options.value === 'object' ? options.valueKey : optValue, newVal || value)\n selectItem.forEach(item => {\n tempArr.push(item[optLabel])\n })\n if (tempArr && tempArr.length) {\n return tempArr.join(',')\n }\n return value\n }\n } else if (['cascader'].includes(type)) {\n if (options && options.options && options.options.length) {\n if (options.props?.emitPath === undefined || options.props?.emitPath === true) {\n value = value && value[0]\n }\n\n const selectItem = findTreeNode(options.options, options.props?.value || 'value', value)[0]\n return selectItem && selectItem[options.props?.label || 'label']\n }\n }\n return null\n}\n\nexport const getSpanValue = (value: any, item: any): any => {\n const type = item.type\n const options = item.options || {}\n const tempArr: string[] = []\n\n\n if (['input', 'input-autocomplete', 'input-number', 'textarea', 'datetime',\n 'date',\n 'dates',\n 'week',\n 'month',\n 'year',\n 'years',\n 'datetimerange',\n 'daterange',\n 'monthrange',\n 'yearrange',].includes(type)) {\n return value\n } else if (['select', 'tree-select', 'select-v2', 'radio', 'radio-button', 'checkbox', 'checkbox-button'].includes(type)) {\n if (options && options.options && options.options.length) {\n let newVal = null\n let optValue = ['select-v2'].includes(type) ? options.props && options.props.value : options.value\n optValue = optValue || 'value'\n let optLabel = ['select-v2'].includes(type) ? options.props && options.props.label : options.label\n optLabel = optLabel || 'label'\n\n if (options.valueKey) {\n newVal = value && value[options.valueKey]\n }\n const selectItem = findTreeNode(options.options, options.value === 'object' ? options.valueKey : optValue, newVal || value)\n selectItem.forEach(item => {\n tempArr.push(item[optLabel])\n })\n if (tempArr && tempArr.length) {\n return tempArr.join(',')\n }\n return value\n }\n } else if (['cascader'].includes(type)) {\n if (options && options.options && options.options.length) {\n if (options.props?.emitPath === undefined || options.props?.emitPath === true) {\n value = value && value[0]\n }\n\n const selectItem = findTreeNode(options.options, options.props?.value || 'value', value)[0]\n return selectItem && selectItem[options.props?.label || 'label']\n }\n }\n return null\n}\n\nexport const valueMouseEnter = (e: MouseEvent, item: any, value: any, _this, itemShowLabel: any) => {\n const showCom = ['input', 'input-autocomplete', 'cascader', 'input-number', 'select', 'tree-select', 'select-v2', 'textarea']\n\n if (!value || (!showCom.includes(item.type) && itemShowLabel !== true)) {\n _this.form.formItem[item.key].tempValueDisabled = true\n return\n }\n let el: HTMLElement | null = null\n if (itemShowLabel) {\n el = e.target as any\n } else if (['input', 'input-autocomplete', 'cascader', 'input-number'].includes(item.type)) {\n el = (e.target as any).parentElement.querySelector('.el-input__inner') || (e.target as any).parentElement.querySelector('.busy-input__inner') as HTMLElement\n } else if (['select', 'tree-select', 'select-v2'].includes(item.type)) {\n el = (e.target as any).parentElement.querySelector('.el-select__selected-item.el-select__placeholder') || (e.target as any).parentElement.querySelector('.busy-select__selected-item.el-select__placeholder') as HTMLElement\n el = el || (e.target as any).parentElement.querySelector('.el-select__selection') || (e.target as any).parentElement.querySelector('.busy-select__selection') as HTMLElement\n }\n\n\n if (el) {\n const inputEl = window.getComputedStyle(el, null)\n const textWidth\n = el.offsetWidth\n - parseInt(inputEl.getPropertyValue('padding-right'))\n - parseInt(inputEl.getPropertyValue('padding-left'))\n const tooltipEl = (e.target as any).previousElementSibling\n const tooltipWidth = tooltipEl.offsetWidth\n\n if (tooltipWidth >= textWidth) {\n _this.form.formItem[item.key].tempValueDisabled = false\n } else {\n _this.form.formItem[item.key].tempValueDisabled = true\n\n }\n } else {\n _this.form.formItem[item.key].tempValueDisabled = true\n }\n\n}\n\nexport const customPlaceholder = (customName: any, type: string = 'input', name: string = '请输入') => {\n name = ['select', 'tree-select', 'cascader', 'select-v2', 'datetime',\n 'datetimerange', 'date', 'daterange', 'dates', 'week', 'month', 'monthrange', 'year', 'years', 'time-picker', 'radio', 'radio-button'].includes(type) ? '请选择' : name\n return name + ((customName) || '')\n}\n\nexport const formItemSlot = (customName: any, name: string = 'formItem_') => {\n return name + (customName || '')\n}\n\n\nexport const renderSlot = (arr: string[] = [], _this: any, slots, item: any): any => {\n\n for (const prop in _this.$slots) {\n const slotName = prop.split('_')\n let slotFn: any = null\n\n if (arr.includes(slotName[2]) && formItemSlot(item.key) + '_' + slotName[2] === prop) {\n\n slotFn = _this.$slots[prop]?.(item)\n // eslint-disable-next-line consistent-return\n isSlotsValue(slotFn) && (slots[slotName[2]] = () => slotFn)\n }\n }\n}\n"],"names":["labelMouseEnter","e","item","_this","el","labelEl","isRequried","labelWidth","findTreeNode","treeData","key","value","result","filterResult","getTooltipValue","type","options","tempArr","newVal","optValue","optLabel","_a","_b","selectItem","_c","_d","getSpanValue","valueMouseEnter","itemShowLabel","inputEl","textWidth","customPlaceholder","customName","name","formItemSlot","renderSlot","arr","slots","prop","slotName","slotFn","isSlotsValue"],"mappings":";AAEO,MAAMA,IAAkB,CAACC,GAAeC,GAAWC,MAAe;AAC/D,QAAAC,IAAMH,EAAE,OAAe,cAAc,eACrCI,IAAU,OAAO,iBAAiBD,GAAI,IAAI,GAC1CE,IAAaJ,EAAK,QAAQ,KAAKA,EAAK,eAAe,GACnDK,IACA,SAASF,EAAQ,iBAAiB,WAAW,CAAC,IAAIC,IAC9C,SAASD,EAAQ,iBAAiB,eAAe,CAAC;AAE5D,EADsBJ,EAAE,OAAe,uBAAuB,eAC1CM,IAChBJ,EAAM,KAAK,SAASD,EAAK,GAAG,EAAE,gBAAgB,KAG9CC,EAAM,KAAK,SAASD,EAAK,GAAG,EAAE,gBAAgB;AAEtD,GAEaM,IAAe,CAACC,GAAeC,GAAaC,MAAkB;AACvE,QAAMC,IAAgB,CAAA;AACtB,WAASC,EAAaJ,GAAe;AACjCA,IAAAA,EAAS,QAAQ,CAACP,MAAc;AAC5B,MAAIA,OACK,MAAM,QAAQS,CAAK,KAAKA,EAAM,SAAST,EAAKQ,CAAG,CAAC,KAAMC,MAAUT,EAAKQ,CAAG,MACzEE,EAAO,KAAKV,CAAI,GAEhBA,EAAK,YAAYA,EAAK,SAAS,UAC/BW,EAAaX,EAAK,QAAQ;AAAA,IAElC,CAEH;AAAA,EACL;AACA,SAAAW,EAAaJ,CAAQ,GACdG;AACX,GAGaE,IAAkB,CAACH,GAAYT,MAAmB;;AAC3D,Q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,EAAK,GAAG,EAAE,oBAAoB,KAElDC,EAAM,KAAK,SAASD,EAAK,GAAG,EAAE,oBAAoB;AAAA,EAEtD;AAEA,IAAAC,EAAM,KAAK,SAASD,EAAK,GAAG,EAAE,oBAAoB;AAG1D,GAEa6B,IAAoB,CAACC,GAAiBjB,IAAe,SAASkB,IAAe,WAC/EA,IAAA;AAAA,EAAC;AAAA,EAAU;AAAA,EAAe;AAAA,EAAY;AAAA,EAAa;AAAA,EACtD;AAAA,EAAiB;AAAA,EAAQ;AAAA,EAAa;AAAA,EAAS;AAAA,EAAQ;AAAA,EAAS;AAAA,EAAc;AAAA,EAAQ;AAAA,EAAS;AAAA,EAAe;AAAA,EAAS;AAAgB,EAAA,SAASlB,CAAI,IAAI,QAAQkB,GAC7JA,KAASD,KAAe,MAGtBE,IAAe,CAACF,GAAiBC,IAAe,gBAClDA,KAAQD,KAAc,KAIpBG,IAAa,CAACC,IAAgB,CAAA,GAAIjC,GAAYkC,GAAOnC,MAAmB;;AAEtE,aAAAoC,KAAQnC,EAAM,QAAQ;AACvB,UAAAoC,IAAWD,EAAK,MAAM,GAAG;AAC/B,QAAIE,IAAc;AAElB,IAAIJ,EAAI,SAASG,EAAS,CAAC,CAAC,KAAKL,EAAahC,EAAK,GAAG,IAAI,MAAMqC,EAAS,CAAC,MAAMD,MAE5EE,KAASlB,KAAAD,IAAAlB,EAAM,QAAOmC,OAAb,gBAAAhB,EAAA,KAAAD,GAAqBnB,IAE9BuC,EAAaD,CAAM,MAAMH,EAAME,EAAS,CAAC,CAAC,IAAI,MAAMC;AAAA,EAE5D;AACJ;"}
@@ -1,22 +1,22 @@
1
- import { defineComponent as P, ref as H, watch as I, nextTick as K, createVNode as n, Fragment as w, resolveComponent as u, mergeProps as C, withDirectives as S, resolveDirective as W, createTextVNode as $, computed as N, isVNode as m } from "vue";
2
- import { getPropByPath as M, dataTransformRod as E } from "../../../utils/tools.mjs";
3
- import { treeNode as q, allShow as z, treeProps as G, allowDrop as J, checkTree as Q, nodeDragEnd as U } from "../hooks/index.mjs";
4
- import { Setting as X, ArrowDown as Y } from "../../../../node_modules/@element-plus/icons-vue/dist/index.mjs";
5
- import { ElMessageBox as F } from "element-plus";
6
- import { buildVueDompurifyHTMLDirective as Z } from "../../../../node_modules/vue-dompurify-html/dist/vue-dompurify-html.mjs";
1
+ import { defineComponent as H, ref as I, watch as K, nextTick as S, createVNode as n, Fragment as w, resolveComponent as u, mergeProps as C, withDirectives as W, resolveDirective as m, createTextVNode as $, computed as N, isVNode as M } from "vue";
2
+ import { getPropByPath as q, dataTransformRod as F } from "../../../utils/tools.mjs";
3
+ import { treeNode as z, allShow as G, treeProps as J, allowDrop as Q, checkTree as U, nodeDragEnd as X } from "../hooks/index.mjs";
4
+ import { Setting as Y, ArrowDown as Z } from "../../../../node_modules/@element-plus/icons-vue/dist/index.mjs";
5
+ import { ElMessageBox as P } from "element-plus";
6
+ import { buildVueDompurifyHTMLDirective as L } from "../../../../node_modules/vue-dompurify-html/dist/vue-dompurify-html.mjs";
7
7
  function O(i) {
8
- return typeof i == "function" || Object.prototype.toString.call(i) === "[object Object]" && !m(i);
8
+ return typeof i == "function" || Object.prototype.toString.call(i) === "[object Object]" && !M(i);
9
9
  }
10
- const L = (i) => {
10
+ const ee = (i) => {
11
11
  const f = {};
12
12
  for (const s in i)
13
13
  s !== "children" && (f[s] = i[s]);
14
14
  return f;
15
- }, ee = {
15
+ }, te = {
16
16
  index: 60,
17
17
  selection: 40,
18
18
  expand: 40
19
- }, te = Z({}), ue = /* @__PURE__ */ P({
19
+ }, ne = L({}), ce = /* @__PURE__ */ H({
20
20
  name: "dinert-recuve-table-column",
21
21
  props: {
22
22
  onlyClass: {
@@ -40,20 +40,20 @@ const L = (i) => {
40
40
  }
41
41
  },
42
42
  directives: {
43
- DompurifyHtml: te
43
+ DompurifyHtml: ne
44
44
  },
45
45
  emits: ["CheckedChange"],
46
46
  setup(i, {
47
47
  emit: f
48
48
  }) {
49
- const s = H();
50
- return I(() => {
49
+ const s = I();
50
+ return K(() => {
51
51
  var o;
52
52
  return (o = i.table) == null ? void 0 : o.key;
53
53
  }, () => {
54
- K(() => {
54
+ S(() => {
55
55
  var o;
56
- s.value && q(s.value, (o = i.table) == null ? void 0 : o.tableColumns);
56
+ s.value && z(s.value, (o = i.table) == null ? void 0 : o.tableColumns);
57
57
  });
58
58
  }, {
59
59
  immediate: !0
@@ -71,7 +71,7 @@ const L = (i) => {
71
71
  type: "primary",
72
72
  onClick: async () => {
73
73
  var a;
74
- return z(s.value, ((a = o.table) == null ? void 0 : a.tableColumns) || []);
74
+ return G(s.value, ((a = o.table) == null ? void 0 : a.tableColumns) || []);
75
75
  }
76
76
  }, {
77
77
  default: () => [$("全选")]
@@ -83,12 +83,12 @@ const L = (i) => {
83
83
  defaultCheckedKeys: o.defaultCheckedKeys,
84
84
  "show-checkbox": !0,
85
85
  "node-key": "prop",
86
- props: G,
87
- allowDrop: J,
86
+ props: J,
87
+ allowDrop: Q,
88
88
  onCheckChange: async (a, d, k) => {
89
- await Q(a, d, k), f("CheckedChange", a, d, k);
89
+ await U(a, d, k), f("CheckedChange", a, d, k);
90
90
  },
91
- onNodeDragEnd: (a, d) => U(a, d, s.value)
91
+ onNodeDragEnd: (a, d) => X(a, d, s.value)
92
92
  }, {
93
93
  default: ({
94
94
  data: a
@@ -106,7 +106,7 @@ const L = (i) => {
106
106
  reference: () => n(u("el-icon"), {
107
107
  class: "setting-icon"
108
108
  }, {
109
- default: () => [n(X, null, null)]
109
+ default: () => [n(Y, null, null)]
110
110
  })
111
111
  }),
112
112
  moreRender: (o, x, {
@@ -134,7 +134,7 @@ const L = (i) => {
134
134
  type: e.key === "delete" ? "danger" : e.type || "primary",
135
135
  link: e.link === void 0 ? !0 : e.link
136
136
  }, {
137
- onClick: () => e.second === "messageBox" || e.key === "delete" ? F({
137
+ onClick: () => e.second === "messageBox" || e.key === "delete" ? P({
138
138
  title: "警告",
139
139
  message: `是否${l}该条数据?`,
140
140
  type: "warning",
@@ -168,7 +168,7 @@ const L = (i) => {
168
168
  }) : r;
169
169
  }), c.value.length && y.value.length > g && n(u("el-dropdown"), {
170
170
  teleported: !0,
171
- onCommand: (e) => e.key === "delete" || e.second ? F({
171
+ onCommand: (e) => e.key === "delete" || e.second ? P({
172
172
  title: "警告",
173
173
  message: `是否${e.message}该条数据?`,
174
174
  type: "warning",
@@ -186,7 +186,7 @@ const L = (i) => {
186
186
  text: !0
187
187
  }, {
188
188
  default: () => [$("更多"), n(u("el-icon"), null, {
189
- default: () => [n(Y, null, null)]
189
+ default: () => [n(Z, null, null)]
190
190
  })]
191
191
  }),
192
192
  dropdown: () => {
@@ -203,7 +203,7 @@ const L = (i) => {
203
203
  });
204
204
  }
205
205
  }) || null]) : n("div", {
206
- class: "cell-item-text"
206
+ class: ["cell-item-text"]
207
207
  }, [k && D || a]);
208
208
  }
209
209
  };
@@ -218,7 +218,7 @@ const L = (i) => {
218
218
  v = v === void 0 || v === !0;
219
219
  const o = t.checked === void 0 || t.checked === !0, x = !["index", "selection", "expand"].includes(t.type), a = t.prop === "operations" && t.fixed === void 0 ? "right" : t.fixed, d = t.showOverflowTooltip === void 0 && t.prop !== "operations" ? !0 : t.showOverflowTooltip, k = `${t.prop || ""} ${t.className || ""} ${t.setting ? "setting" : ""}`;
220
220
  let D = t.prop === "operations" && t.align === void 0 ? "center" : t.align, h = t.prop === "operations" && t.width === void 0 ? 200 : t.width;
221
- const y = t.formatter && typeof t.formatter == "function", g = L(t), p = (V = t.prop) == null ? void 0 : V.toLocaleLowerCase();
221
+ const y = t.formatter && typeof t.formatter == "function", g = ee(t), p = (V = t.prop) == null ? void 0 : V.toLocaleLowerCase();
222
222
  if (p != null && p.includes("time") || p != null && p.includes("date") ? h = h || 170 : (p != null && p.includes("status") || p != null && p.includes("state")) && (h = h || 100, D = t.align || "center"), v && o && x)
223
223
  return n(u("el-table-column"), C(g, {
224
224
  key: t.prop,
@@ -230,21 +230,21 @@ const L = (i) => {
230
230
  align: D
231
231
  }), {
232
232
  default: (c) => {
233
- var R, T, j, _, A;
234
- const e = M(c.row, t.prop || ""), l = E(e, (R = this.table) == null ? void 0 : R.errData), r = f == null ? void 0 : f({
233
+ var R, T, j, _, A, E;
234
+ const e = q(c.row, t.prop || ""), l = F(e, (R = this.table) == null ? void 0 : R.errData), r = f == null ? void 0 : f({
235
235
  ...c,
236
236
  prop: t.prop
237
237
  }), b = r && r[0] && r[0].children;
238
238
  if (y) {
239
239
  let B = t.formatter && t.formatter(c, t, e, c.$index, (T = this.table) == null ? void 0 : T.errData);
240
- return B = E(B, (j = this.table) == null ? void 0 : j.errData), n(w, null, [b ? n("div", {
240
+ return B = F(B, (j = this.table) == null ? void 0 : j.errData), n(w, null, [b ? n("div", {
241
241
  class: ["cell-item"]
242
242
  }, [f == null ? void 0 : f({
243
243
  ...c,
244
244
  prop: t.prop
245
- })]) : S(n("div", {
245
+ })]) : W(n("div", {
246
246
  class: ["cell-item", B === ((_ = this.table) == null ? void 0 : _.errData) ? "empty-value" : ""]
247
- }, null), [[W("dompurify-html"), B]]), n(u("dinert-recuve-table-column"), {
247
+ }, null), [[m("dompurify-html"), B]]), n(u("dinert-recuve-table-column"), {
248
248
  table: this.table,
249
249
  key: t.prop,
250
250
  tableColumns: t.children,
@@ -253,7 +253,7 @@ const L = (i) => {
253
253
  }, i)]);
254
254
  } else
255
255
  return n(w, null, [n("div", {
256
- class: ["cell-item", l === ((A = this.table) == null ? void 0 : A.errData) ? "empty-value" : ""]
256
+ class: ["cell-item", l === ((A = this.table) == null ? void 0 : A.errData) || b === ((E = this.table) == null ? void 0 : E.errData) ? "empty-value" : ""]
257
257
  }, [this.moreRender(t, this, {
258
258
  value: l,
259
259
  scope: c,
@@ -282,7 +282,7 @@ const L = (i) => {
282
282
  }
283
283
  });
284
284
  if (v && o) {
285
- const c = t.align === void 0 ? "center" : "left", e = t.width === void 0 ? ee[t.type || ""] || 60 : t.width;
285
+ const c = t.align === void 0 ? "center" : "left", e = t.width === void 0 ? te[t.type || ""] || 60 : t.width;
286
286
  return n(u("el-table-column"), C(t, {
287
287
  key: t.prop,
288
288
  fixed: a,
@@ -296,6 +296,6 @@ const L = (i) => {
296
296
  }
297
297
  });
298
298
  export {
299
- ue as default
299
+ ce as default
300
300
  };
301
301
  //# sourceMappingURL=recuve-table-column.mjs.map