@dinert/element-plus 1.1.8 → 1.1.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -39,20 +39,20 @@ const we = /* @__PURE__ */ R({
39
39
  form: b
40
40
  } = $(f), t = F(() => {
41
41
  let s = 0;
42
- const p = [];
42
+ const i = [];
43
43
  return Object.keys(b.value.formItem).forEach((d) => {
44
- const i = b.value.formItem[d];
45
- p.push({
46
- ...i,
44
+ const p = b.value.formItem[d];
45
+ i.push({
46
+ ...p,
47
47
  key: d,
48
- sort: typeof i.sort > "u" ? s : i.sort
48
+ sort: typeof p.sort > "u" ? s : p.sort
49
49
  }), s += 10;
50
- }), p.sort((d, i) => d.sort - i.sort), p;
50
+ }), i.sort((d, p) => d.sort - p.sort), i;
51
51
  }), r = () => {
52
52
  let s = document.querySelectorAll(`.${a.value} .el-form-left > div`);
53
53
  s[0] && (u.value = !1, U(() => {
54
- const p = s[0].getBoundingClientRect().top, d = s[s.length - 1].getBoundingClientRect().top;
55
- p !== d ? u.value = !0 : (l.value || (l.value = !0), u.value = !1), s = null;
54
+ const i = s[0].getBoundingClientRect().top, d = s[s.length - 1].getBoundingClientRect().top;
55
+ i !== d ? u.value = !0 : (l.value || (l.value = !0), u.value = !1), s = null;
56
56
  }));
57
57
  };
58
58
  return P(() => {
@@ -86,7 +86,7 @@ const we = /* @__PURE__ */ R({
86
86
  u = u === void 0 ? !0 : u;
87
87
  let m = typeof e.show == "function" ? e.show(this.form.model) : e.show;
88
88
  if (m = m === void 0 ? !0 : m, m || (l.display = "none"), u) {
89
- e.required = e.required === void 0 ? e.required || this.form.required : e.required, e.showLabel = e.showLabel === void 0 ? e.showLabel || this.form.showLabel : e.showLabel;
89
+ e.required = e.required === void 0 ? e.required || this.form.required : e.required, e.showLabel = e.showLabel === void 0 ? e.showLabel || this.form.showLabel : e.showLabel, e.label = typeof e.label == "string" ? e.label : e.label(this.form.model);
90
90
  let a = e.rules || [];
91
91
  a = e.required ? [{
92
92
  required: !0,
@@ -129,7 +129,7 @@ const we = /* @__PURE__ */ R({
129
129
  onLabelMouseEnter: (t) => K(t, e, this.form.model[e.key], this)
130
130
  }, {
131
131
  default: () => {
132
- var C, s, p, d, i, I;
132
+ var C, s, i, d, p, I;
133
133
  const t = {};
134
134
  let r = o("span", null, [X(this.form.model[e.key])]);
135
135
  if (this.$slots[c(e.key)])
@@ -141,7 +141,7 @@ const we = /* @__PURE__ */ R({
141
141
  if (e.showLabel || this.form.showLabel && [!0, void 0].includes(e.showLabel))
142
142
  return r;
143
143
  if (["input", "textarea"].includes(e.type)) {
144
- const g = (d = (p = this.$slots)[c(e.key + "_append")]) == null ? void 0 : d.call(p), S = g && g[0] && g[0].children, v = (I = (i = this.$slots)[c(e.key + "_prepend")]) == null ? void 0 : I.call(i), _ = v && v[0] && v[0].children;
144
+ const g = (d = (i = this.$slots)[c(e.key + "_append")]) == null ? void 0 : d.call(i), S = g && g[0] && g[0].children, v = (I = (p = this.$slots)[c(e.key + "_prepend")]) == null ? void 0 : I.call(p), _ = v && v[0] && v[0].children;
145
145
  S && (t.append = () => {
146
146
  var h, y;
147
147
  return (y = (h = this.$slots)[c(e.key + "_append")]) == null ? void 0 : y.call(h);
@@ -1 +1 @@
1
- {"version":3,"file":"index.mjs","sources":["../../../../../packages/components/form/src/index.tsx"],"sourcesContent":["import {defineComponent, ref, computed, nextTick, toRefs} 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'\n\nimport useWindowResize from '@packages/hooks/useWindowResize'\nimport {labelMouseEnter, valueMouseEnter, getTooltipValue, formItemSlot, customPlaceholder} 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\n const packUp = ref(true)\n const isArrow = ref(false)\n const formRef = ref<InstanceType<typeof ElForm>>()\n const formClass = ref('form_' + getUuid())\n const {form} = toRefs(props)\n const formItemMap = computed(() => {\n let index = 0\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 sort: typeof value.sort === 'undefined' ? index : value.sort,\n })\n index += 10\n })\n\n result.sort((a: any, b: any) => {\n return a.sort - b.sort\n })\n\n return result\n })\n\n const resizeForm = () => {\n let elFormLeft = document.querySelectorAll(`.${formClass.value} .el-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 unfold,\n formClass,\n\n formRef,\n packUp,\n isArrow\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 <el-row {...this.form.row} class=\"el-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 ? true : vif\n\n let show = typeof item.show === 'function' ? item.show(this.form.model) : item.show\n show = show === undefined ? true : show\n\n if (!show) {\n style.display = 'none'\n }\n if (vif) {\n item.required = item.required === undefined ? item.required || this.form.required : item.required\n item.showLabel = item.showLabel === undefined ? item.showLabel || this.form.showLabel : item.showLabel\n\n let rules = item.rules || []\n rules = item.required ? [{required: true, trigger: 'blur', message: customPlaceholder(item.label, item.type)}].concat(rules as any) : rules\n rules = item.showLabel ? [] : rules\n const valDisabled = item.showLabel ? true : 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' : '', item.showLabel || this.form.showLabel ? 'show-label' : '']}\n {...{\n ...item,\n rules: rules\n }}\n v-slots={{\n label: () => {\n return (\n <dinert-tooltip\n key={item.key}\n content={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)}\n v-slots={\n {\n default: () => {\n\n\n const slots: any = {}\n\n let componentResult = <span>{dataTransformRod(this.form.model[item.key])}</span>\n\n\n if (this.$slots[formItemSlot(item.key)]) {\n componentResult = (this.$slots[formItemSlot(item.key)]?.({...item, model: this.form.model}))\n } else if (item.showLabel || (this.form.showLabel && [true, undefined].includes(item.showLabel))) {\n return componentResult\n } else if (['input', 'textarea'].includes(item.type)) {\n const appendSlot = this.$slots[formItemSlot(item.key + '_append')]?.()\n const appendSlotValue = appendSlot && appendSlot[0] && appendSlot[0].children\n\n const prependSlot = this.$slots[formItemSlot(item.key + '_prepend')]?.()\n const prependSlotValue = prependSlot && prependSlot[0] && prependSlot[0].children\n if (appendSlotValue) {\n slots.append = () => this.$slots[formItemSlot(item.key + '_append')]?.()\n }\n if (prependSlotValue) {\n slots.prepend = () => this.$slots[formItemSlot(item.key + '_prepend')]?.()\n }\n componentResult = (<CustomInput form={this.form} formItem={item} v-slots={slots}></CustomInput>)\n } else if (['input-number'].includes(item.type)) {\n componentResult = (<CustomInputNumber form={this.form} formItem={item}></CustomInputNumber>)\n } else if (['input-autocomplete'].includes(item.type)) {\n componentResult = (<CustomInputAutocomplete form={this.form} formItem={item}></CustomInputAutocomplete>)\n } else if (['select'].includes(item.type)) {\n componentResult = (<CustomSelect form={this.form} formItem={item}></CustomSelect>)\n } else if (['select-v2'].includes(item.type)) {\n componentResult = (<CustomSelectV2 form={this.form} formItem={item}></CustomSelectV2>)\n } else if (['switch'].includes(item.type)) {\n componentResult = (<CustomSwitch form={this.form} formItem={item}></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 componentResult = (<CustomDate form={this.form} formItem={item}></CustomDate>)\n } else if (['radio', 'radio-button'].includes(item.type)) {\n componentResult = (<CustomRadio form={this.form} formItem={item}></CustomRadio>)\n } else if (['tree-select'].includes(item.type)) {\n componentResult = (<CustomSelectTree form={this.form} formItem={item}></CustomSelectTree>)\n } else if (['rate'].includes(item.type)) {\n componentResult = (<CustomRate form={this.form} formItem={item}></CustomRate>)\n } else if (['checkbox', 'checkbox-button'].includes(item.type)) {\n componentResult = (<CustomCheckbox form={this.form} formItem={item}></CustomCheckbox>)\n } else if (['cascader'].includes(item.type)) {\n componentResult = (<CustomCascader form={this.form} formItem={item}></CustomCascader>)\n }\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={['el-form-right', this.isArrow ? 'isArrow' : '']}>\n {this.isArrow\n && <el-button class=\"el-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')}>搜索</el-button>\n <el-button type=\"primary\" plain\n onClick={() => this.$emit('ResetFn')}\n >重置</el-button>\n </>\n )\n }\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","packUp","ref","isArrow","formRef","formClass","getUuid","toRefs","formItemMap","computed","index","result","keys","value","formItem","forEach","key","push","sort","a","b","resizeForm","elFormLeft","document","querySelectorAll","nextTick","firstTop","getBoundingClientRect","top","lastTop","length","useWindowResize","unfold","render","_slot","_createVNode","_resolveComponent","_mergeProps","el","row","map","item","style","vif","model","undefined","show","display","required","showLabel","rules","trigger","message","customPlaceholder","label","concat","valDisabled","tempValueDisabled","colLayout","labelWrap","labelDisabled","e","labelMouseEnter","String","getTooltipValue","valueMouseEnter","slots","componentResult","dataTransformRod","$slots","formItemSlot","_b","_a","includes","appendSlot","_d","_c","appendSlotValue","children","prependSlot","_f","_e","prependSlotValue","append","prepend","CustomInput","CustomInputNumber","CustomInputAutocomplete","CustomSelect","CustomSelectV2","CustomSwitch","CustomDate","CustomRadio","CustomSelectTree","CustomRate","CustomCheckbox","CustomCascader","defaultAfter","defaultBefore","ArrowUp","ArrowDown","form_search","_Fragment","onClick","$emit","_createTextVNode"],"mappings":";;;;;;;;;;;;;;;;;;AAuB+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;AAEjB,UAAMC,IAASC,EAAI,EAAI,GACjBC,IAAUD,EAAI,EAAK,GACnBE,IAAUF,KACVG,IAAYH,EAAI,UAAUI,EAAS,CAAA,GACnC;AAAA,MAACb,MAAAA;AAAAA,IAAI,IAAIc,EAAOf,CAAK,GACrBgB,IAAcC,EAAS,MAAM;AAC/B,UAAIC,IAAQ;AACZ,YAAMC,IAAc,CAAA;AACpB1B,oBAAO2B,KAAKnB,EAAKoB,MAAMC,QAAQ,EAAEC,QAAQC,CAAAA,MAAO;AAC5C,cAAMH,IAAQpB,EAAKoB,MAAMC,SAASE,CAAG;AACrCL,QAAAA,EAAOM,KAAK;AAAA,UACR,GAAGJ;AAAAA,UACHG,KAAKA;AAAAA,UACLE,MAAM,OAAOL,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AA,GAAA;AAAA,YAAA,OAAA;AAAA,YAAA,MAAA;AAAA,YAAA,MAAA;AAAA,YAAA,SAEA,KAAKJ;AAAAA,UAAM,GAAA;AAAA,YAAArC,SAAAA,MAAAwC,CAAAA,EAAAC,EAAA,SAAA,GAAA,MAAA;AAAA,cAAAzC,SAAAA,MAGf,CAAA,KAAKM,SAAMkC,EAAAgE,GAAA,MAAA,IAAA,IAAAhE,EAAAiE,GAA4B,MAAA,IAAA,CAAA;AAAA,YAAA,CAAA,GAE3C,KAAKnG,SAAS,OAAO,IAAI;AAAA,UAAA,CAAA,KAG7BsE,KAAAC,IAAA,KAAKH,QAAOgC,gBAAZ,gBAAA9B,EAAA,KAAAC,OAA2BrC,EAAAmE,GAAAnE,MAAAA,CAAAA,EAAAC,EAAA,WAAA,GAAA;AAAA,YAAA,MAAA;AAAA,YAAA,SAGmBmE,MAAM,KAAKC,MAAM,UAAU;AAAA,UAAC,GAAA;AAAA,YAAA7G,SAAAA,MAAA,CAAA8G,EAAA,IAAA,CAAA;AAAA,UAAAtE,CAAAA,GAAAA,EAAAC,EAAA,WAAA,GAAA;AAAA,YAAA,MAAA;AAAA,YAAA,OAAA;AAAA,YAAA,SAElDmE,MAAM,KAAKC,MAAM,SAAS;AAAA,UAAC,GAAA;AAAA,YAAA7G,SAAAA,MAAA,CAAA8G,EAAA,IAAA,CAAA;AAAA,UAG/C,CAAA,CAAA,CAAA,CAAA;AAAA;AAAA,OAEA,CAAA;AAAA,IAAA,CAAA;AAAA,EAIrB;AACJ,CAAC;"}
1
+ {"version":3,"file":"index.mjs","sources":["../../../../../packages/components/form/src/index.tsx"],"sourcesContent":["import {defineComponent, ref, computed, nextTick, toRefs} 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'\n\nimport useWindowResize from '@packages/hooks/useWindowResize'\nimport {labelMouseEnter, valueMouseEnter, getTooltipValue, formItemSlot, customPlaceholder} 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\n const packUp = ref(true)\n const isArrow = ref(false)\n const formRef = ref<InstanceType<typeof ElForm>>()\n const formClass = ref('form_' + getUuid())\n const {form} = toRefs(props)\n const formItemMap = computed(() => {\n let index = 0\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 sort: typeof value.sort === 'undefined' ? index : value.sort,\n })\n index += 10\n })\n\n result.sort((a: any, b: any) => {\n return a.sort - b.sort\n })\n\n return result\n })\n\n const resizeForm = () => {\n let elFormLeft = document.querySelectorAll(`.${formClass.value} .el-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 unfold,\n formClass,\n\n formRef,\n packUp,\n isArrow\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 <el-row {...this.form.row} class=\"el-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 ? true : vif\n\n let show = typeof item.show === 'function' ? item.show(this.form.model) : item.show\n show = show === undefined ? true : show\n\n if (!show) {\n style.display = 'none'\n }\n if (vif) {\n item.required = item.required === undefined ? item.required || this.form.required : item.required\n item.showLabel = item.showLabel === undefined ? item.showLabel || this.form.showLabel : item.showLabel\n item.label = typeof item.label === 'string' ? item.label : item.label(this.form.model)\n\n let rules = item.rules || []\n rules = item.required ? [{required: true, trigger: 'blur', message: customPlaceholder(item.label, item.type)}].concat(rules as any) : rules\n rules = item.showLabel ? [] : rules\n const valDisabled = item.showLabel ? true : 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' : '', item.showLabel || this.form.showLabel ? 'show-label' : '']}\n {...{\n ...item,\n rules: rules\n }}\n v-slots={{\n label: () => {\n return (\n <dinert-tooltip\n key={item.key}\n content={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)}\n v-slots={\n {\n default: () => {\n\n\n const slots: any = {}\n\n let componentResult = <span>{dataTransformRod(this.form.model[item.key])}</span>\n\n\n if (this.$slots[formItemSlot(item.key)]) {\n componentResult = (this.$slots[formItemSlot(item.key)]?.({...item, model: this.form.model}))\n } else if (item.showLabel || (this.form.showLabel && [true, undefined].includes(item.showLabel))) {\n return componentResult\n } else if (['input', 'textarea'].includes(item.type)) {\n const appendSlot = this.$slots[formItemSlot(item.key + '_append')]?.()\n const appendSlotValue = appendSlot && appendSlot[0] && appendSlot[0].children\n\n const prependSlot = this.$slots[formItemSlot(item.key + '_prepend')]?.()\n const prependSlotValue = prependSlot && prependSlot[0] && prependSlot[0].children\n if (appendSlotValue) {\n slots.append = () => this.$slots[formItemSlot(item.key + '_append')]?.()\n }\n if (prependSlotValue) {\n slots.prepend = () => this.$slots[formItemSlot(item.key + '_prepend')]?.()\n }\n componentResult = (<CustomInput form={this.form} formItem={item} v-slots={slots}></CustomInput>)\n } else if (['input-number'].includes(item.type)) {\n componentResult = (<CustomInputNumber form={this.form} formItem={item}></CustomInputNumber>)\n } else if (['input-autocomplete'].includes(item.type)) {\n componentResult = (<CustomInputAutocomplete form={this.form} formItem={item}></CustomInputAutocomplete>)\n } else if (['select'].includes(item.type)) {\n componentResult = (<CustomSelect form={this.form} formItem={item}></CustomSelect>)\n } else if (['select-v2'].includes(item.type)) {\n componentResult = (<CustomSelectV2 form={this.form} formItem={item}></CustomSelectV2>)\n } else if (['switch'].includes(item.type)) {\n componentResult = (<CustomSwitch form={this.form} formItem={item}></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 componentResult = (<CustomDate form={this.form} formItem={item}></CustomDate>)\n } else if (['radio', 'radio-button'].includes(item.type)) {\n componentResult = (<CustomRadio form={this.form} formItem={item}></CustomRadio>)\n } else if (['tree-select'].includes(item.type)) {\n componentResult = (<CustomSelectTree form={this.form} formItem={item}></CustomSelectTree>)\n } else if (['rate'].includes(item.type)) {\n componentResult = (<CustomRate form={this.form} formItem={item}></CustomRate>)\n } else if (['checkbox', 'checkbox-button'].includes(item.type)) {\n componentResult = (<CustomCheckbox form={this.form} formItem={item}></CustomCheckbox>)\n } else if (['cascader'].includes(item.type)) {\n componentResult = (<CustomCascader form={this.form} formItem={item}></CustomCascader>)\n }\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={['el-form-right', this.isArrow ? 'isArrow' : '']}>\n {this.isArrow\n && <el-button class=\"el-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')}>搜索</el-button>\n <el-button type=\"primary\" plain\n onClick={() => this.$emit('ResetFn')}\n >重置</el-button>\n </>\n )\n }\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","packUp","ref","isArrow","formRef","formClass","getUuid","toRefs","formItemMap","computed","index","result","keys","value","formItem","forEach","key","push","sort","a","b","resizeForm","elFormLeft","document","querySelectorAll","nextTick","firstTop","getBoundingClientRect","top","lastTop","length","useWindowResize","unfold","render","_slot","_createVNode","_resolveComponent","_mergeProps","el","row","map","item","style","vif","model","undefined","show","display","required","showLabel","label","rules","trigger","message","customPlaceholder","concat","valDisabled","tempValueDisabled","colLayout","labelWrap","labelDisabled","e","labelMouseEnter","String","getTooltipValue","valueMouseEnter","slots","componentResult","dataTransformRod","$slots","formItemSlot","_b","_a","includes","appendSlot","_d","_c","appendSlotValue","children","prependSlot","_f","_e","prependSlotValue","append","prepend","CustomInput","CustomInputNumber","CustomInputAutocomplete","CustomSelect","CustomSelectV2","CustomSwitch","CustomDate","CustomRadio","CustomSelectTree","CustomRate","CustomCheckbox","CustomCascader","defaultAfter","defaultBefore","ArrowUp","ArrowDown","form_search","_Fragment","onClick","$emit","_createTextVNode"],"mappings":";;;;;;;;;;;;;;;;;;AAuB+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;AAEjB,UAAMC,IAASC,EAAI,EAAI,GACjBC,IAAUD,EAAI,EAAK,GACnBE,IAAUF,KACVG,IAAYH,EAAI,UAAUI,EAAS,CAAA,GACnC;AAAA,MAACb,MAAAA;AAAAA,IAAI,IAAIc,EAAOf,CAAK,GACrBgB,IAAcC,EAAS,MAAM;AAC/B,UAAIC,IAAQ;AACZ,YAAMC,IAAc,CAAA;AACpB1B,oB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A;AAAA,EAIrB;AACJ,CAAC;"}
@@ -1,20 +1,20 @@
1
- import { defineComponent as $, ref as E, watch as F, nextTick as A, createVNode as n, Fragment as v, resolveComponent as u, mergeProps as x, withDirectives as P, resolveDirective as W, createTextVNode as T, computed as N, isVNode as m } from "vue";
2
- import { getPropByPath as B, dataTransformRod as K } from "../../../utils/tools.mjs";
3
- import { treeNode as S, allShow as I, treeProps as q, allowDrop as z, checkTree as G, nodeDragEnd as H } from "../hooks/index.mjs";
1
+ import { defineComponent as _, ref as $, watch as A, nextTick as F, createVNode as n, Fragment as w, resolveComponent as a, mergeProps as x, withDirectives as P, resolveDirective as E, createTextVNode as R, computed as T, isVNode as K } from "vue";
2
+ import { getPropByPath as S, dataTransformRod as W } from "../../../utils/tools.mjs";
3
+ import { treeNode as B, allShow as I, treeProps as q, allowDrop as z, checkTree as G, nodeDragEnd as H } from "../hooks/index.mjs";
4
4
  import { Setting as J, ArrowDown as M } from "../../../../node_modules/@element-plus/icons-vue/dist/index.mjs";
5
- function R(d) {
6
- return typeof d == "function" || Object.prototype.toString.call(d) === "[object Object]" && !m(d);
5
+ function D(i) {
6
+ return typeof i == "function" || Object.prototype.toString.call(i) === "[object Object]" && !K(i);
7
7
  }
8
- const Q = (d) => {
9
- const p = {};
10
- for (const s in d)
11
- s !== "children" && (p[s] = d[s]);
12
- return p;
8
+ const Q = (i) => {
9
+ const f = {};
10
+ for (const r in i)
11
+ r !== "children" && (f[r] = i[r]);
12
+ return f;
13
13
  }, U = {
14
14
  index: 60,
15
15
  selection: 40,
16
16
  expand: 40
17
- }, ee = /* @__PURE__ */ $({
17
+ }, L = /* @__PURE__ */ _({
18
18
  name: "dinert-recuve-table-column",
19
19
  props: {
20
20
  onlyClass: {
@@ -38,142 +38,142 @@ const Q = (d) => {
38
38
  }
39
39
  },
40
40
  emits: ["CheckedChange"],
41
- setup(d, {
42
- emit: p
41
+ setup(i, {
42
+ emit: f
43
43
  }) {
44
- const s = E();
45
- return F(() => {
46
- var o;
47
- return (o = d.table) == null ? void 0 : o.key;
44
+ const r = $();
45
+ return A(() => {
46
+ var t;
47
+ return (t = i.table) == null ? void 0 : t.key;
48
48
  }, () => {
49
- A(() => {
50
- var o;
51
- s.value && S(s.value, (o = d.table) == null ? void 0 : o.tableColumns);
49
+ F(() => {
50
+ var t;
51
+ r.value && B(r.value, (t = i.table) == null ? void 0 : t.tableColumns);
52
52
  });
53
53
  }, {
54
54
  immediate: !0
55
55
  }), {
56
- settingRender: (o) => n(u("el-popover"), {
57
- value: o.popoverValue
56
+ settingRender: (t) => n(a("el-popover"), {
57
+ value: t.popoverValue
58
58
  }, {
59
59
  default: () => {
60
- var k;
60
+ var C;
61
61
  return n("ul", {
62
62
  class: "el-popover-classify"
63
- }, [n("li", null, [n(u("el-button"), {
63
+ }, [n("li", null, [n(a("el-button"), {
64
64
  class: "allSelect",
65
65
  link: !0,
66
66
  type: "primary",
67
67
  onClick: async () => {
68
- var a;
69
- return I(s.value, ((a = o.table) == null ? void 0 : a.tableColumns) || []);
68
+ var s;
69
+ return I(r.value, ((s = t.table) == null ? void 0 : s.tableColumns) || []);
70
70
  }
71
71
  }, {
72
- default: () => [T("全选")]
73
- })]), n(u("el-tree"), {
74
- ref: s,
72
+ default: () => [R("全选")]
73
+ })]), n(a("el-tree"), {
74
+ ref: r,
75
75
  draggable: !0,
76
- data: (k = o.table) == null ? void 0 : k.tableColumns,
76
+ data: (C = t.table) == null ? void 0 : C.tableColumns,
77
77
  "default-expand-all": !0,
78
- defaultCheckedKeys: o.defaultCheckedKeys,
78
+ defaultCheckedKeys: t.defaultCheckedKeys,
79
79
  "show-checkbox": !0,
80
80
  "node-key": "prop",
81
81
  props: q,
82
82
  allowDrop: z,
83
- onCheckChange: async (a, c, b) => {
84
- await G(a, c, b), p("CheckedChange", a, c, b);
83
+ onCheckChange: async (s, p, k) => {
84
+ await G(s, p, k), f("CheckedChange", s, p, k);
85
85
  },
86
- onNodeDragEnd: (a, c) => H(a, c, s.value)
86
+ onNodeDragEnd: (s, p) => H(s, p, r.value)
87
87
  }, {
88
88
  default: ({
89
- data: a
89
+ data: s
90
90
  }) => n("div", {
91
91
  class: "text-dot tree-item"
92
- }, [n(u("el-tooltip"), {
93
- content: a.label,
92
+ }, [n(a("el-tooltip"), {
93
+ content: s.label,
94
94
  placement: "top",
95
- disabled: a.label && a.label.length < 8
95
+ disabled: s.label && s.label.length < 8
96
96
  }, {
97
- default: () => n("span", null, [a.label])
97
+ default: () => n("span", null, [s.label])
98
98
  })])
99
99
  })]);
100
100
  },
101
- reference: () => n(u("el-icon"), {
101
+ reference: () => n(a("el-icon"), {
102
102
  class: "setting-icon"
103
103
  }, {
104
104
  default: () => [n(J, null, null)]
105
105
  })
106
106
  }),
107
- moreRender: (o, k, {
108
- value: a,
109
- scope: c,
110
- isSlotValue: b,
107
+ moreRender: (t, C, {
108
+ value: s,
109
+ scope: p,
110
+ isSlotValue: k,
111
111
  slotValue: V
112
112
  }) => {
113
- const O = o.operations || {}, h = N(() => {
113
+ const h = t.operations || {}, g = T(() => {
114
114
  let l = 0;
115
- const t = [];
116
- return Object.keys(O).forEach((i) => {
117
- const r = O[i];
118
- (typeof r.show != "function" && [!0, void 0].includes(r.show) || typeof r.show == "function" && [!0, void 0].includes(r.show(c, o, r))) && t.push({
119
- key: i,
120
- ...r,
121
- sort: typeof r.sort > "u" ? l : r.sort
115
+ const o = [];
116
+ return Object.keys(h).forEach((d) => {
117
+ const c = h[d];
118
+ (typeof c.show != "function" && [!0, void 0].includes(c.show) || typeof c.show == "function" && [!0, void 0].includes(c.show(p, t, c))) && o.push({
119
+ key: d,
120
+ ...c,
121
+ sort: typeof c.sort > "u" ? l : c.sort
122
122
  }), l += 10;
123
- }), t.sort((i, r) => i.sort - r.sort), t;
123
+ }), o.sort((d, c) => d.sort - c.sort), o;
124
124
  });
125
- let y = o.maxOperations || 3;
126
- y = h.value.length > y ? y - 1 : y;
127
- const f = N(() => h.value.slice(0, y)), w = N(() => h.value.slice(y, h.value.length));
128
- return h.value && h.value.length ? n(v, null, [f.value.map((l) => {
129
- const t = typeof l.message == "function" ? l.message(c, o, l) : l.message;
130
- return l.key === "delete" ? n(u("el-popconfirm"), x({
131
- title: "是否删除该数据"
125
+ let b = t.maxOperations || 3;
126
+ b = g.value.length > b ? b - 1 : b;
127
+ const O = T(() => g.value.slice(0, b)), u = T(() => g.value.slice(b, g.value.length));
128
+ return g.value && g.value.length ? n(w, null, [O.value.map((l) => {
129
+ const o = typeof l.message == "function" ? l.message(p, t, l) : l.message;
130
+ return l.key === "delete" || l.second ? n(a("el-popconfirm"), x({
131
+ title: l.key === "delete" ? "是否删除该数据?" : "二次确认"
132
132
  }, {
133
133
  ...l.confirm
134
134
  }, {
135
- onConfirm: () => l.click && l.click(c, o, l)
135
+ onConfirm: () => l.click && l.click(p, t, l)
136
136
  }), {
137
- reference: () => n(u("el-button"), x({
137
+ reference: () => n(a("el-button"), x({
138
138
  ...l,
139
- type: l.type || "primary",
139
+ type: l.type || l.key === "delete" ? "danger" : "primary",
140
140
  link: l.link === void 0 ? !0 : l.link
141
141
  }, {
142
142
  key: l.key
143
- }), R(t) ? t : {
144
- default: () => [t]
143
+ }), D(o) ? o : {
144
+ default: () => [o]
145
145
  })
146
- }) : n(u("el-button"), x({
146
+ }) : n(a("el-button"), x({
147
147
  ...l,
148
148
  type: l.type || "primary",
149
149
  link: l.link === void 0 ? !0 : l.link
150
150
  }, {
151
- onClick: () => l.click && l.click(c, o, l),
151
+ onClick: () => l.click && l.click(p, t, l),
152
152
  key: l.key
153
- }), R(t) ? t : {
154
- default: () => [t]
153
+ }), D(o) ? o : {
154
+ default: () => [o]
155
155
  });
156
- }), w.value.length && h.value.length > y && n(u("el-dropdown"), {
156
+ }), u.value.length && g.value.length > b && n(a("el-dropdown"), {
157
157
  teleported: !0,
158
- onCommand: (l) => l.click && l.click(c, o, l)
158
+ onCommand: (l) => l.click && l.click(p, t, l)
159
159
  }, {
160
- default: () => n(u("el-button"), {
160
+ default: () => n(a("el-button"), {
161
161
  type: "primary",
162
162
  link: !0,
163
163
  text: !0
164
164
  }, {
165
- default: () => [T("更多"), n(u("el-icon"), null, {
165
+ default: () => [R("更多"), n(a("el-icon"), null, {
166
166
  default: () => [n(M, null, null)]
167
167
  })]
168
168
  }),
169
169
  dropdown: () => {
170
170
  let l;
171
- return n(u("el-dropdown-menu"), null, R(l = w.value.map((t) => {
172
- const i = typeof t.message == "function" ? t.message(c, o, t) : t.message;
173
- return n(u("el-dropdown-item"), {
174
- command: t
175
- }, R(i) ? i : {
176
- default: () => [i]
171
+ return n(a("el-dropdown-menu"), null, D(l = u.value.map((o) => {
172
+ const d = typeof o.message == "function" ? o.message(p, t, o) : o.message;
173
+ return n(a("el-dropdown-item"), {
174
+ command: o
175
+ }, D(d) ? d : {
176
+ default: () => [d]
177
177
  });
178
178
  })) ? l : {
179
179
  default: () => [l]
@@ -181,93 +181,91 @@ const Q = (d) => {
181
181
  }
182
182
  }) || null]) : n("div", {
183
183
  class: "cell-item-text"
184
- }, [b && V || a]);
184
+ }, [k && V || s]);
185
185
  }
186
186
  };
187
187
  },
188
188
  render() {
189
- const d = this.$slots, p = d.default, s = d.header;
190
- return n(v, null, [
189
+ const i = this.$slots, f = i.default, r = i.header;
190
+ return n(w, null, [
191
191
  // eslint-disable-next-line array-callback-return, consistent-return
192
192
  this.tableColumns && this.tableColumns.map((e) => {
193
- var w;
194
- let g = typeof e.show == "function" ? e.show(e) : e.show;
195
- g = g === void 0 || g === !0;
196
- const o = e.checked === void 0 || e.checked === !0, k = !["index", "selection", "expand"].includes(e.type), a = e.prop === "operations" && e.fixed === void 0 ? "right" : e.fixed, c = e.showOverflowTooltip === void 0 && e.prop !== "operations" ? !0 : e.showOverflowTooltip, b = `${e.prop || ""} ${e.className || ""} ${e.setting ? "setting" : ""}`;
197
- let V = e.prop === "operations" && e.align === void 0 ? "center" : e.align;
198
- const O = e.prop === "operations" && e.width === void 0 ? 200 : e.width, h = e.formatter && typeof e.formatter == "function", y = Q(e);
199
- let D = 0;
200
- const f = (w = e.prop) == null ? void 0 : w.toLocaleLowerCase();
201
- if (f != null && f.includes("time") ? D = 170 : (f != null && f.includes("status") || f != null && f.includes("state")) && (D = 80, V = e.align || "center"), g && o && k)
202
- return n(u("el-table-column"), x(y, {
193
+ var O;
194
+ let v = typeof e.show == "function" ? e.show(e) : e.show;
195
+ v = v === void 0 || v === !0;
196
+ const t = e.checked === void 0 || e.checked === !0, C = !["index", "selection", "expand"].includes(e.type), s = e.prop === "operations" && e.fixed === void 0 ? "right" : e.fixed, p = e.showOverflowTooltip === void 0 && e.prop !== "operations" ? !0 : e.showOverflowTooltip, k = `${e.prop || ""} ${e.className || ""} ${e.setting ? "setting" : ""}`;
197
+ let V = e.prop === "operations" && e.align === void 0 ? "center" : e.align, h = e.prop === "operations" && e.width === void 0 ? 200 : e.width;
198
+ const g = e.formatter && typeof e.formatter == "function", b = Q(e), y = (O = e.prop) == null ? void 0 : O.toLocaleLowerCase();
199
+ if (y != null && y.includes("time") ? h = h || 170 : (y != null && y.includes("status") || y != null && y.includes("state")) && (h = h || 80, V = e.align || "center"), v && t && C)
200
+ return n(a("el-table-column"), x(b, {
203
201
  key: e.prop,
204
- fixed: a,
205
- "show-overflow-tooltip": c,
206
- className: b,
207
- width: O,
208
- minWidth: e.minWidth || D,
202
+ fixed: s,
203
+ "show-overflow-tooltip": p,
204
+ className: k,
205
+ width: h,
206
+ minWidth: e.minWidth,
209
207
  align: V
210
208
  }), {
211
- default: (l) => {
212
- var j;
213
- const t = B(l.row, e.prop || ""), i = K(t, (j = this.table) == null ? void 0 : j.errData), r = p == null ? void 0 : p({
214
- ...l,
209
+ default: (u) => {
210
+ var N;
211
+ const l = S(u.row, e.prop || ""), o = W(l, (N = this.table) == null ? void 0 : N.errData), d = f == null ? void 0 : f({
212
+ ...u,
215
213
  prop: e.prop
216
- }), C = r && r[0] && r[0].children;
217
- if (h) {
218
- const _ = e.formatter && e.formatter(l, e, t, l.$index);
219
- return n(v, null, [C ? n("div", {
214
+ }), c = d && d[0] && d[0].children;
215
+ if (g) {
216
+ const j = e.formatter && e.formatter(u, e, l, u.$index);
217
+ return n(w, null, [c ? n("div", {
220
218
  class: "cell-item"
221
- }, [p == null ? void 0 : p({
222
- ...l,
219
+ }, [f == null ? void 0 : f({
220
+ ...u,
223
221
  prop: e.prop
224
222
  })]) : P(n("div", {
225
223
  class: "cell-item"
226
- }, null), [[W("dompurify-html"), _]]), n(u("dinert-recuve-table-column"), {
224
+ }, null), [[E("dompurify-html"), j]]), n(a("dinert-recuve-table-column"), {
227
225
  table: this.table,
228
226
  key: e.prop,
229
227
  tableColumns: e.children,
230
228
  "popover-value": this.popoverValue,
231
229
  "only-class": this.onlyClass
232
- }, d)]);
230
+ }, i)]);
233
231
  } else
234
- return n(v, null, [n("div", {
232
+ return n(w, null, [n("div", {
235
233
  class: "cell-item"
236
234
  }, [this.moreRender(e, this, {
237
- value: i,
238
- scope: l,
239
- isSlotValue: C,
240
- slotValue: r
241
- })]), n(u("dinert-recuve-table-column"), {
235
+ value: o,
236
+ scope: u,
237
+ isSlotValue: c,
238
+ slotValue: d
239
+ })]), n(a("dinert-recuve-table-column"), {
242
240
  table: this.table,
243
241
  key: e.prop,
244
242
  tableColumns: e.children,
245
243
  "popover-value": this.popoverValue,
246
244
  "only-class": this.onlyClass
247
- }, d)]);
245
+ }, i)]);
248
246
  },
249
- header: (l) => {
250
- var r, C;
251
- const t = s == null ? void 0 : s({
252
- ...l,
247
+ header: (u) => {
248
+ var d, c;
249
+ const l = r == null ? void 0 : r({
250
+ ...u,
253
251
  data: e,
254
252
  prop: e.prop
255
- }), i = t && t[0] && t[0].children;
256
- return s ? n(v, null, [T(" "), n("span", null, [i ? s == null ? void 0 : s({
257
- ...l,
253
+ }), o = l && l[0] && l[0].children;
254
+ return r ? n(w, null, [R(" "), n("span", null, [o ? r == null ? void 0 : r({
255
+ ...u,
258
256
  data: e,
259
257
  prop: e.prop
260
- }) : l.column.label]), e.setting && ((r = this.table) == null ? void 0 : r.setting) !== !1 && this.settingRender(this)]) : n(v, null, [n("span", null, [l.column.label]), e.setting && ((C = this.table) == null ? void 0 : C.setting) !== !1 && this.settingRender(this)]);
258
+ }) : u.column.label]), e.setting && ((d = this.table) == null ? void 0 : d.setting) !== !1 && this.settingRender(this)]) : n(w, null, [n("span", null, [u.column.label]), e.setting && ((c = this.table) == null ? void 0 : c.setting) !== !1 && this.settingRender(this)]);
261
259
  }
262
260
  });
263
- if (g && o) {
264
- const l = e.align === void 0 ? "center" : "left", t = e.width === void 0 ? U[e.type || ""] || 60 : e.width;
265
- return n(u("el-table-column"), x(e, {
261
+ if (v && t) {
262
+ const u = e.align === void 0 ? "center" : "left", l = e.width === void 0 ? U[e.type || ""] || 60 : e.width;
263
+ return n(a("el-table-column"), x(e, {
266
264
  key: e.prop,
267
- fixed: a,
268
- align: l,
265
+ fixed: s,
266
+ align: u,
269
267
  "reserve-selection": e.reserveSelection,
270
- width: t
268
+ width: l
271
269
  }), this.$slots);
272
270
  }
273
271
  })
@@ -275,6 +273,6 @@ const Q = (d) => {
275
273
  }
276
274
  });
277
275
  export {
278
- ee as default
276
+ L as default
279
277
  };
280
278
  //# sourceMappingURL=recuve-table-column.mjs.map