@dinert/element-plus 1.1.36 → 1.1.38

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.
@@ -1,5 +1,5 @@
1
1
  import { isSlotsValue as h } from "../../../utils/tools.mjs";
2
- const g = (t, l, o) => {
2
+ const y = (t, l, o) => {
3
3
  const e = t.target.parentElement.parentElement, r = window.getComputedStyle(e, null), s = l.rules ? 12 : l.beforeWidth || 0, n = parseInt(r.getPropertyValue("max-width")) - s - parseInt(r.getPropertyValue("padding-right"));
4
4
  t.target.previousElementSibling.offsetWidth >= n ? o.form.formItem[l.key].labelDisabled = !1 : o.form.formItem[l.key].labelDisabled = !0;
5
5
  }, d = (t, l, o) => {
@@ -10,7 +10,7 @@ const g = (t, l, o) => {
10
10
  });
11
11
  }
12
12
  return r(t), e;
13
- }, y = (t, l) => {
13
+ }, I = (t, l) => {
14
14
  var s, n, p, a;
15
15
  const o = l.type, e = l.options || {}, r = [];
16
16
  if (["input", "input-autocomplete", "input-number"].includes(o))
@@ -30,7 +30,7 @@ const g = (t, l, o) => {
30
30
  return i && i[((a = e.props) == null ? void 0 : a.label) || "label"];
31
31
  }
32
32
  return null;
33
- }, I = (t, l) => {
33
+ }, E = (t, l) => {
34
34
  var s, n, p, a;
35
35
  const o = l.type, e = l.options || {}, r = [];
36
36
  if ([
@@ -66,7 +66,7 @@ const g = (t, l, o) => {
66
66
  return i && i[((a = e.props) == null ? void 0 : a.label) || "label"];
67
67
  }
68
68
  return null;
69
- }, E = (t, l, o, e) => {
69
+ }, V = (t, l, o, e) => {
70
70
  const r = ["input", "input-autocomplete", "cascader", "input-number", "select", "tree-select", "select-v2"];
71
71
  if (!o || l.showLabel || !r.includes(l.type)) {
72
72
  e.form.formItem[l.key].tempValueDisabled = !0;
@@ -78,7 +78,7 @@ const g = (t, l, o) => {
78
78
  t.target.previousElementSibling.offsetWidth >= p ? e.form.formItem[l.key].tempValueDisabled = !1 : e.form.formItem[l.key].tempValueDisabled = !0;
79
79
  } else
80
80
  e.form.formItem[l.key].tempValueDisabled = !0;
81
- }, V = (t, l = "input", o = "请输入") => (o = [
81
+ }, v = (t, l = "input", o = "请输入") => (o = [
82
82
  "select",
83
83
  "tree-select",
84
84
  "cascader",
@@ -94,24 +94,24 @@ const g = (t, l, o) => {
94
94
  "year",
95
95
  "years",
96
96
  "time-picker"
97
- ].includes(l) ? "请选择" : o, o + (t || "")), v = (t, l = "formItem_") => l + (t || ""), w = (t = [], l, o, e) => {
97
+ ].includes(l) ? "请选择" : o, o + (t || "")), b = (t, l = "formItem_") => l + (t || ""), k = (t = [], l, o, e) => {
98
98
  var r, s;
99
99
  for (const n in l.$slots) {
100
100
  const p = n.split("formItem_").join("").split("_")[1];
101
101
  let a = null;
102
102
  if (!p)
103
103
  return;
104
- t.includes(p) && (a = (s = (r = l.$slots)[n]) == null ? void 0 : s.call(r, e), h(a) && (o[p] = () => a));
104
+ t.includes(p) && b(e.key) + "_" + p === n && (a = (s = (r = l.$slots)[n]) == null ? void 0 : s.call(r, e), h(a) && (o[p] = () => a));
105
105
  }
106
106
  };
107
107
  export {
108
- V as customPlaceholder,
108
+ v as customPlaceholder,
109
109
  d as findTreeNode,
110
- v as formItemSlot,
111
- I as getSpanValue,
112
- y as getTooltipValue,
113
- g as labelMouseEnter,
114
- w as renderSlot,
115
- E as valueMouseEnter
110
+ b as formItemSlot,
111
+ E as getSpanValue,
112
+ I as getTooltipValue,
113
+ y as labelMouseEnter,
114
+ k as renderSlot,
115
+ V as valueMouseEnter
116
116
  };
117
117
  //# 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) => {\n const showCom = ['input', 'input-autocomplete', 'cascader', 'input-number', 'select', 'tree-select', 'select-v2']\n\n if (!value || item.showLabel || !showCom.includes(item.type)) {\n _this.form.formItem[item.key].tempValueDisabled = true\n\n return\n }\n let el: HTMLElement | null = null\n if (['input', 'input-autocomplete', 'cascader', 'input-number'].includes(item.type)) {\n el = (e.target as any).parentElement.querySelector('.el-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') as HTMLElement\n el = el || (e.target as any).parentElement.querySelector('.el-select__selection') as HTMLElement\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'].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 let slotFn: any = null\n if (!slotName) {\n return\n }\n if (arr.includes(slotName)) {\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","showCom","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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Q,MACrBC,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) => {\n const showCom = ['input', 'input-autocomplete', 'cascader', 'input-number', 'select', 'tree-select', 'select-v2']\n\n if (!value || item.showLabel || !showCom.includes(item.type)) {\n _this.form.formItem[item.key].tempValueDisabled = true\n\n return\n }\n let el: HTMLElement | null = null\n if (['input', 'input-autocomplete', 'cascader', 'input-number'].includes(item.type)) {\n el = (e.target as any).parentElement.querySelector('.el-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') as HTMLElement\n el = el || (e.target as any).parentElement.querySelector('.el-select__selection') as HTMLElement\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'].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","showCom","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,QAAMa,IAAOb,EAAK,MACZc,IAAUd,EAAK,WAAW,IAC1Be,IAAoB,CAAA;AAC1B,MAAI,CAAC,SAAS,sBAAsB,cAAc,EAAE,SAASF,CAAI;AACtD,WAAAJ;AACX,MAAW,CAAC,UAAU,eAAe,WAAW,EAAE,SAASI,CAAI;AAC3D,QAAIC,KAAWA,EAA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;AAAA,EAAS;AAAA,EAAc;AAAA,EAAQ;AAAA,EAAS;AAAe,EAAA,SAASlB,CAAI,IAAI,QAAQkB,GACpIA,KAASD,KAAe,MAGtBE,IAAe,CAACF,GAAiBC,IAAe,gBAClDA,KAAQD,KAAc,KAIpBG,IAAa,CAACC,IAAgB,CAAA,GAAIjC,GAAYkC,GAAOnC,MAAmB;;AACtE,aAAAoC,KAAQnC,EAAM,QAAQ;AACvB,UAAAoC,IAAWD,EAAK,MAAM,WAAW,EAAE,KAAK,EAAE,EAAE,MAAM,GAAG,EAAE,CAAC;AAE9D,QAAIE,IAAc;AAClB,QAAI,CAACD;AACD;AAGA,IAAAH,EAAI,SAASG,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,11 +1,11 @@
1
- import { defineComponent as L, ref as r, toRefs as O, computed as z, shallowRef as u, onMounted as V, watch as A, nextTick as D, createVNode as a, resolveComponent as i, mergeProps as w, createTextVNode as F } from "vue";
2
- import { getUuid as H, getTreeNode as E, columnProp as N, headerProp as U } from "../../../utils/tools.mjs";
3
- import { treeNode as M, isAllChecked as W, nodeDragEnd as I, allShow as q, treeProps as G, allowDrop as J, resizeTaleHeight as Q } from "../hooks/index.mjs";
1
+ import { defineComponent as L, ref as r, toRefs as O, computed as F, shallowRef as h, onMounted as V, watch as I, nextTick as E, createVNode as l, resolveComponent as i, mergeProps as $, createTextVNode as j } from "vue";
2
+ import { getUuid as H, getTreeNode as K, columnProp as N, headerProp as U } from "../../../utils/tools.mjs";
3
+ import { treeNode as M, isAllChecked as W, nodeDragEnd as P, allShow as q, treeProps as G, allowDrop as J, resizeTaleHeight as Q } from "../hooks/index.mjs";
4
4
  import X from "./recuve-table-column.mjs";
5
5
  import Y from "../../../hooks/useWindowResize.mjs";
6
- import { Plus as Z, Delete as ee, Download as te, Upload as le, Check as ae, Close as se, ArrowDown as j, ArrowUp as ne } from "../../../../node_modules/@element-plus/icons-vue/dist/index.mjs";
6
+ import { Plus as Z, Delete as ee, Download as te, Upload as le, Check as ae, Close as se, ArrowDown as B, ArrowUp as oe } from "../../../../node_modules/@element-plus/icons-vue/dist/index.mjs";
7
7
  import "../../../assets/scss/dinert-table.scss.mjs";
8
- const ce = /* @__PURE__ */ L({
8
+ const pe = /* @__PURE__ */ L({
9
9
  name: "dinert-table",
10
10
  props: {
11
11
  table: {
@@ -25,150 +25,150 @@ const ce = /* @__PURE__ */ L({
25
25
  }
26
26
  },
27
27
  emits: ["SizeChange", "CurrentChange", "CheckedChange"],
28
- setup(h, {
28
+ setup(f, {
29
29
  emit: R,
30
- slots: S
30
+ slots: D
31
31
  }) {
32
- const c = r(), k = r(!1), $ = r("table_" + H()), f = r(), b = r(!0), g = r(null), y = r(null), m = r(null), T = r(null), _ = r(null), {
33
- table: e,
34
- header: l
35
- } = O(h), s = z(() => {
32
+ const c = r(), k = r(!1), T = r("table_" + H()), b = r(), g = r(!0), y = r(null), m = r(null), C = r(null), _ = r(null), S = r(null), {
33
+ table: x,
34
+ header: p
35
+ } = O(f), d = F(() => {
36
36
  var t;
37
- const o = ((t = e.value) == null ? void 0 : t.tableColumns) || [];
38
- function n(x) {
39
- x.sort((C, v) => (C.sort || 1 / 0) - (v.sort || 1 / 0));
40
- for (let C = 0; C < x.length; C++) {
41
- const v = x[C];
42
- v.children && v.children.length && n(v.children);
37
+ const o = ((t = x.value) == null ? void 0 : t.tableColumns) || [];
38
+ function s(A) {
39
+ A.sort((v, w) => (v.sort || 1 / 0) - (w.sort || 1 / 0));
40
+ for (let v = 0; v < A.length; v++) {
41
+ const w = A[v];
42
+ w.children && w.children.length && s(w.children);
43
43
  }
44
44
  }
45
- return n(o), o;
46
- }), d = z(() => {
47
- if (typeof l.value == "boolean")
48
- return l.value;
45
+ return s(o), o;
46
+ }), z = F(() => {
47
+ if (typeof p.value == "boolean")
48
+ return p.value;
49
49
  const o = [];
50
- return Object.keys(l.value).forEach((n) => {
51
- const t = l.value[n];
52
- n === "add" ? (t.icon = t.icon || u(Z), t.type = "primary", t.message = t.message || "新增") : n === "delete" ? (t.icon = t.icon || u(ee), t.plain = t.plain === void 0 ? "plain" : t.plain, t.type = t.type === void 0 ? "danger" : t.type, t.message = t.message || "删除") : n === "download" ? (t.icon = t.icon || u(te), t.plain = t.plain === void 0 ? "plain" : t.plain, t.type = "primary", t.message = t.message || "下载") : n === "upload" ? (t.icon = t.icon || u(le), t.plain = t.plain === void 0 ? "plain" : t.plain, t.type = "primary", t.message = t.message || "上传") : n === "select" ? (t.icon = t.icon || u(ae), t.plain = t.plain === void 0 ? "plain" : t.plain, t.message = t.message || "全选") : n === "close" ? (t.icon = t.icon || u(se), t.plain = t.plain === void 0 ? "plain" : t.plain, t.message = t.message || "取消全选") : n === "down" ? (t.icon = t.icon || u(j), t.plain = t.plain === void 0 ? "plain" : t.plain, t.message = t.message || "展开") : n === "up" && (t.icon = t.icon || u(ne), t.plain = t.plain === void 0 ? "plain" : t.plain, t.message = t.message || "收起"), o.push({
53
- key: n,
50
+ return Object.keys(p.value).forEach((s) => {
51
+ const t = p.value[s];
52
+ s === "add" ? (t.icon = t.icon || h(Z), t.type = "primary", t.message = t.message || "新增") : s === "delete" ? (t.icon = t.icon || h(ee), t.plain = t.plain === void 0 ? "plain" : t.plain, t.type = t.type === void 0 ? "danger" : t.type, t.message = t.message || "删除") : s === "download" ? (t.icon = t.icon || h(te), t.plain = t.plain === void 0 ? "plain" : t.plain, t.type = "primary", t.message = t.message || "下载") : s === "upload" ? (t.icon = t.icon || h(le), t.plain = t.plain === void 0 ? "plain" : t.plain, t.type = "primary", t.message = t.message || "上传") : s === "select" ? (t.icon = t.icon || h(ae), t.plain = t.plain === void 0 ? "plain" : t.plain, t.message = t.message || "全选") : s === "close" ? (t.icon = t.icon || h(se), t.plain = t.plain === void 0 ? "plain" : t.plain, t.message = t.message || "取消全选") : s === "down" ? (t.icon = t.icon || h(B), t.plain = t.plain === void 0 ? "plain" : t.plain, t.message = t.message || "展开") : s === "up" && (t.icon = t.icon || h(oe), t.plain = t.plain === void 0 ? "plain" : t.plain, t.message = t.message || "收起"), o.push({
53
+ key: s,
54
54
  ...t,
55
55
  type: t.type || "default"
56
56
  });
57
- }), o.sort((n, t) => (n.sort || 1 / 0) - (t.sort || 1 / 0)), o;
58
- }), p = () => {
59
- !S["table-body"] && Q(c.value, g.value, y.value, m.value, h.table);
57
+ }), o.sort((s, t) => (s.sort || 1 / 0) - (t.sort || 1 / 0)), o;
58
+ }), e = () => {
59
+ !D["table-body"] && Q(c.value, y.value, m.value, C.value, f.table);
60
60
  };
61
61
  V(() => {
62
62
  setTimeout(() => {
63
- p();
63
+ e();
64
64
  });
65
65
  });
66
- const K = z(() => {
66
+ const a = F(() => {
67
67
  var o;
68
- return E(s.value, "setting", [!0], "setting").length === 0 && ((o = h.table) == null ? void 0 : o.setting) !== !1;
69
- }), P = E(s.value, "checked", [!0, void 0], "prop"), B = (o, n, t) => {
70
- o.checked = t || n, R("CheckedChange", o, n, t), D(() => {
71
- p();
68
+ return K(d.value, "setting", [!0], "setting").length === 0 && ((o = f.table) == null ? void 0 : o.setting) !== !1;
69
+ }), n = K(d.value, "checked", [!0, void 0], "prop"), u = (o, s, t) => {
70
+ o.checked = t || s, R("CheckedChange", o, s, t), E(() => {
71
+ e();
72
72
  });
73
73
  };
74
74
  return Y(() => {
75
- p();
76
- }, 100), A(() => {
75
+ e();
76
+ }, 100), I(() => {
77
77
  var o;
78
- return (o = h.table) == null ? void 0 : o.key;
78
+ return (o = f.table) == null ? void 0 : o.key;
79
79
  }, () => {
80
- D(async () => {
81
- await M(f.value, s.value), setTimeout(() => {
82
- p();
80
+ E(async () => {
81
+ await M(b.value, d.value), setTimeout(() => {
82
+ e();
83
83
  });
84
84
  });
85
85
  }, {
86
86
  immediate: !0
87
- }), A(s, () => {
88
- D(() => {
89
- b.value = W(s.value);
87
+ }), I(d, () => {
88
+ E(() => {
89
+ g.value = W(d.value);
90
90
  });
91
91
  }, {
92
92
  deep: !0
93
93
  }), {
94
- getSetting: K,
95
- tableColumns: s,
96
- checkTree: B,
97
- defaultCheckedKeys: P,
98
- resizeTaleHeightFn: p,
99
- nodeDragEnd: I,
94
+ getSetting: a,
95
+ tableColumns: d,
96
+ checkTree: u,
97
+ defaultCheckedKeys: n,
98
+ resizeTaleHeightFn: e,
99
+ nodeDragEnd: P,
100
100
  popoverValue: k,
101
- onlyClass: $,
102
- isAllData: b,
103
- isFooter: h.footer,
104
- headerList: d,
101
+ onlyClass: T,
102
+ isAllData: g,
103
+ isFooter: f.footer,
104
+ headerList: z,
105
105
  tableRef: c,
106
- headerRef: g,
107
- headerFooterRef: T,
108
- headerTitleRef: _,
109
- bodyRef: y,
110
- footerRef: m,
111
- selectTableRef: f
106
+ headerRef: y,
107
+ headerFooterRef: _,
108
+ headerTitleRef: S,
109
+ bodyRef: m,
110
+ footerRef: C,
111
+ selectTableRef: b
112
112
  };
113
113
  },
114
114
  render() {
115
- var c, k, $, f, b, g, y, m, T, _;
116
- const h = this.tableSlot ? this.$slots : {
115
+ var c, k, T, b, g, y, m, C, _, S, x, p, d, z;
116
+ const f = this.tableSlot ? this.$slots : {
117
117
  ...this.$slots,
118
118
  default: (e) => {
119
- var l, s;
120
- return (s = (l = this.$slots)[e.prop && N(e.prop)]) == null ? void 0 : s.call(l, e);
119
+ var a, n;
120
+ return (n = (a = this.$slots)[e.prop && N(e.prop)]) == null ? void 0 : n.call(a, e);
121
121
  },
122
122
  header: (e) => {
123
- var l, s;
124
- return (s = (l = this.$slots)[e.prop && U(e.prop)]) == null ? void 0 : s.call(l, e);
123
+ var a, n;
124
+ return (n = (a = this.$slots)[e.prop && U(e.prop)]) == null ? void 0 : n.call(a, e);
125
125
  }
126
- }, R = typeof this.headerList != "boolean" ? this.headerList : [], S = this.header && R.length || this.getSetting && this.header;
127
- return a("section", {
126
+ }, R = typeof this.headerList != "boolean" ? this.headerList : [], D = this.header && R.length || this.getSetting && this.header;
127
+ return l("section", {
128
128
  class: "dinert-table"
129
- }, [this.$slots["header-title"] && a("header", {
129
+ }, [this.$slots["header-title"] && l("header", {
130
130
  class: "dinert-table-headerTitle",
131
131
  ref: (e) => {
132
132
  this.headerTitleRef = e;
133
133
  }
134
- }, [(k = (c = this.$slots)["header-title"]) == null ? void 0 : k.call(c)]), S && a("header", {
134
+ }, [(k = (c = this.$slots)["header-title"]) == null ? void 0 : k.call(c)]), D && l("header", {
135
135
  class: "dinert-table-header",
136
136
  ref: (e) => {
137
137
  this.headerRef = e;
138
138
  }
139
- }, [a("div", {
139
+ }, [l("div", {
140
140
  class: "dinert-table-header-left"
141
141
  }, [R.map((e) => {
142
- var s, d;
142
+ var n, u;
143
143
  if (this.$slots["header_left_" + e.key])
144
- return (d = (s = this.$slots)["header_left_" + e.key]) == null ? void 0 : d.call(s, e);
145
- const l = typeof e.disabled == "function" ? e.disabled(e) : e.disabled;
146
- return typeof e.show != "function" && [!0, void 0].includes(e.show) || typeof e.show == "function" && [!0, void 0].includes(e.show(e)) ? a(i("el-button"), w({
144
+ return (u = (n = this.$slots)["header_left_" + e.key]) == null ? void 0 : u.call(n, e);
145
+ const a = typeof e.disabled == "function" ? e.disabled(e) : e.disabled;
146
+ return typeof e.show != "function" && [!0, void 0].includes(e.show) || typeof e.show == "function" && [!0, void 0].includes(e.show(e)) ? l(i("el-button"), $({
147
147
  ...e,
148
- disabled: l,
148
+ disabled: a,
149
149
  type: e.type || "primary"
150
150
  }, {
151
151
  onClick: () => e.click && e.click(e)
152
152
  }), {
153
153
  default: () => [e.message]
154
154
  }) : null;
155
- })]), this.getSetting && a("div", {
155
+ })]), this.getSetting && l("div", {
156
156
  class: "dinert-table-header-right"
157
- }, [a(i("el-button-group"), null, {
158
- default: () => [a(i("el-button"), {
157
+ }, [l(i("el-button-group"), null, {
158
+ default: () => [l(i("el-button"), {
159
159
  type: this.isAllData ? "primary" : "default",
160
160
  onClick: async () => {
161
161
  var e;
162
162
  q(this.selectTableRef, ((e = this.table) == null ? void 0 : e.tableColumns) || []);
163
163
  }
164
164
  }, {
165
- default: () => [F("全部显示")]
166
- }), a(i("el-popover"), {
165
+ default: () => [j("全部显示")]
166
+ }), l(i("el-popover"), {
167
167
  teleported: !1
168
168
  }, {
169
- default: () => a("ul", {
169
+ default: () => l("ul", {
170
170
  class: "dinert-popover-classify"
171
- }, [a(i("el-tree"), {
171
+ }, [l(i("el-tree"), {
172
172
  ref: (e) => this.selectTableRef = e,
173
173
  draggable: !0,
174
174
  data: this.tableColumns,
@@ -178,98 +178,102 @@ const ce = /* @__PURE__ */ L({
178
178
  "node-key": "prop",
179
179
  props: G,
180
180
  "allow-drop": J,
181
- onCheckChange: (e, l, s) => this.checkTree(e, l, s),
182
- onNodeDragEnd: (e, l) => {
183
- const s = e.data.sort, d = l.data.sort;
184
- e.data.sort = d, l.data.sort = s, I(e, l, this.selectTableRef);
181
+ onCheckChange: (e, a, n) => this.checkTree(e, a, n),
182
+ onNodeDragEnd: (e, a) => {
183
+ const n = e.data.sort, u = a.data.sort;
184
+ e.data.sort = u, a.data.sort = n, P(e, a, this.selectTableRef);
185
185
  }
186
186
  }, {
187
187
  default: ({
188
188
  data: e
189
- }) => a("div", {
189
+ }) => l("div", {
190
190
  class: "text-dot tree-item"
191
- }, [a(i("el-tooltip"), {
191
+ }, [l(i("el-tooltip"), {
192
192
  content: e.label,
193
193
  placement: "top",
194
194
  disabled: e.label && e.label.length < 8
195
195
  }, {
196
- default: () => a("span", null, [e.label])
196
+ default: () => l("span", null, [e.label])
197
197
  })])
198
198
  })]),
199
- reference: () => a(i("el-button"), {
199
+ reference: () => l(i("el-button"), {
200
200
  type: this.isAllData ? "" : "primary"
201
201
  }, {
202
- default: () => [F("分类显示"), a(i("el-icon"), null, {
203
- default: () => [a(j, null, null)]
202
+ default: () => [j("分类显示"), l(i("el-icon"), null, {
203
+ default: () => [l(B, null, null)]
204
204
  })]
205
205
  })
206
206
  })]
207
- })])]), this.$slots["header-footer"] && a("header", {
207
+ })])]), this.$slots["header-footer"] && l("header", {
208
208
  class: "dinert-table-headerFooter",
209
209
  ref: (e) => {
210
210
  this.headerFooterRef = e;
211
211
  }
212
- }, [(f = ($ = this.$slots)["header-footer"]) == null ? void 0 : f.call($)]), a("div", {
212
+ }, [(b = (T = this.$slots)["header-footer"]) == null ? void 0 : b.call(T)]), l("div", {
213
213
  ref: (e) => {
214
214
  this.bodyRef = e;
215
215
  },
216
216
  class: "dinert-table-body"
217
- }, [this.$slots["table-body"] ? (g = (b = this.$slots)["table-body"]) == null ? void 0 : g.call(b, this.table) : a(i("el-table"), w({
217
+ }, [this.$slots["table-body"] ? (y = (g = this.$slots)["table-body"]) == null ? void 0 : y.call(g, this.table) : l(i("el-table"), $({
218
218
  height: "100%",
219
219
  border: !0
220
220
  }, this.table, {
221
221
  ref: (e) => {
222
222
  this.tableRef = e;
223
223
  },
224
- "row-key": (y = this.table) == null ? void 0 : y.rowKey
224
+ "row-key": (m = this.table) == null ? void 0 : m.rowKey
225
225
  }), {
226
226
  default: () => {
227
- var e, l;
228
- return [((e = this.table) == null ? void 0 : e.rowSelection) && a(i("el-table-column"), w({
227
+ var e, a;
228
+ return [((e = this.table) == null ? void 0 : e.rowSelection) && l(i("el-table-column"), $({
229
229
  width: "60",
230
230
  align: "center",
231
231
  type: "selection"
232
- }, this.table.rowSelection), null), ((l = this.table) == null ? void 0 : l.rowIndex) && a(i("el-table-column"), w({
232
+ }, this.table.rowSelection), null), ((a = this.table) == null ? void 0 : a.rowIndex) && l(i("el-table-column"), $({
233
233
  width: "60",
234
234
  align: "center",
235
235
  type: "index",
236
236
  label: "序号"
237
- }, this.table.rowIndex), null), a(X, {
237
+ }, this.table.rowIndex), null), l(X, {
238
238
  table: this.table,
239
239
  "table-columns": this.tableColumns,
240
240
  "only-class": this.onlyClass,
241
241
  "popover-value": this.popoverValue,
242
242
  defaultCheckedKeys: this.defaultCheckedKeys,
243
- onCheckedChange: (s, d, p) => this.$emit("CheckedChange", s, d, p)
244
- }, h)];
243
+ onCheckedChange: (n, u, o) => this.$emit("CheckedChange", n, u, o)
244
+ }, f)];
245
245
  },
246
246
  empty: this.$slots["table-empty"] ? () => {
247
- var e, l;
248
- return (l = (e = this.$slots)["table-empty"]) == null ? void 0 : l.call(e);
247
+ var e, a;
248
+ return (a = (e = this.$slots)["table-empty"]) == null ? void 0 : a.call(e);
249
249
  } : null,
250
250
  append: this.$slots["table-append"] ? () => {
251
- var e, l;
252
- return (l = (e = this.$slots)["table-append"]) == null ? void 0 : l.call(e);
251
+ var e, a;
252
+ return (a = (e = this.$slots)["table-append"]) == null ? void 0 : a.call(e);
253
253
  } : null
254
- })]), this.isFooter && ((m = this.table) == null ? void 0 : m.data) && ((T = this.table) == null ? void 0 : T.data.length) !== 0 && a("div", {
254
+ })]), this.isFooter && ((C = this.table) == null ? void 0 : C.data) && ((_ = this.table) == null ? void 0 : _.data.length) !== 0 && l("div", {
255
255
  class: "dinert-table-footer",
256
256
  ref: (e) => {
257
257
  this.footerRef = e;
258
258
  }
259
- }, [a(i("el-pagination"), w({
259
+ }, [this.$slots["table-footer-left"] ? l("div", {
260
+ class: "dinert-table-footer-left"
261
+ }, [(x = (S = this.$slots)["table-footer-left"]) == null ? void 0 : x.call(S)]) : null, l(i("el-pagination"), $({
260
262
  "model:current-page": 1,
261
263
  "model:page-size": 15,
262
264
  pageSizes: [15, 30, 50, 70, 100],
263
265
  "default-page-size": 15,
264
266
  layout: "total, sizes, prev, pager, next, jumper",
265
267
  total: 100
266
- }, (_ = this.table) == null ? void 0 : _.pagination, {
268
+ }, (p = this.table) == null ? void 0 : p.pagination, {
267
269
  onSizeChange: (e) => this.$emit("SizeChange", e),
268
270
  onCurrentChange: (e) => this.$emit("CurrentChange", e)
269
- }), null)])]);
271
+ }), null), this.$slots["table-footer-right"] ? l("div", {
272
+ class: "dinert-table-footer-right"
273
+ }, [(z = (d = this.$slots)["table-footer-right"]) == null ? void 0 : z.call(d)]) : null])]);
270
274
  }
271
275
  });
272
276
  export {
273
- ce as default
277
+ pe as default
274
278
  };
275
279
  //# sourceMappingURL=index.mjs.map