@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.
- package/dist/element-plus.umd.js +2 -2
- package/dist/element-plus.umd.js.map +1 -1
- package/dist/style.css +1 -1
- package/es/packages/assets/scss/dinert-form.scss +20 -2
- package/es/packages/components/form/src/checkbox.mjs +13 -11
- package/es/packages/components/form/src/checkbox.mjs.map +1 -1
- package/es/packages/components/form/src/index.mjs +42 -36
- package/es/packages/components/form/src/index.mjs.map +1 -1
- package/es/packages/components/form/src/radio.mjs +13 -11
- package/es/packages/components/form/src/radio.mjs.map +1 -1
- package/es/packages/components/form/utils/index.mjs +14 -14
- package/es/packages/components/form/utils/index.mjs.map +1 -1
- package/es/packages/components/table/src/index.mjs +115 -111
- package/es/packages/components/table/src/index.mjs.map +1 -1
- package/es/src/components/form/types/index.d.ts +2 -1
- package/es/style.css +1 -1
- package/lib/index.js +2 -2
- package/lib/index.js.map +1 -1
- package/lib/src/components/form/types/index.d.ts +2 -1
- package/lib/style.css +1 -1
- package/package.json +1 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { isSlotsValue as h } from "../../../utils/tools.mjs";
|
|
2
|
-
const
|
|
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
|
-
},
|
|
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
|
-
},
|
|
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
|
-
},
|
|
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
|
-
},
|
|
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 || "")),
|
|
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
|
-
|
|
108
|
+
v as customPlaceholder,
|
|
109
109
|
d as findTreeNode,
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
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,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,EA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IAClD,SAASA,EAAQ,iBAAiB,cAAc,CAAC;AAI/D,IAHmB5B,EAAE,OAAe,uBACL,eAEX6B,IAChB3B,EAAM,KAAK,SAASD,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;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;AAC9D,QAAIE,IAAc;AAClB,QAAI,CAACD;AACD;AAEA,IAAAH,EAAI,SAASG,CAAQ,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,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AAE,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
|
|
2
|
-
import { getUuid as H, getTreeNode as
|
|
3
|
-
import { treeNode as M, isAllChecked as W, nodeDragEnd as
|
|
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
|
|
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
|
|
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(
|
|
28
|
+
setup(f, {
|
|
29
29
|
emit: R,
|
|
30
|
-
slots:
|
|
30
|
+
slots: D
|
|
31
31
|
}) {
|
|
32
|
-
const c = r(), k = r(!1),
|
|
33
|
-
table:
|
|
34
|
-
header:
|
|
35
|
-
} = O(
|
|
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 =
|
|
38
|
-
function
|
|
39
|
-
|
|
40
|
-
for (let
|
|
41
|
-
const
|
|
42
|
-
|
|
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
|
|
46
|
-
}),
|
|
47
|
-
if (typeof
|
|
48
|
-
return
|
|
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(
|
|
51
|
-
const t =
|
|
52
|
-
|
|
53
|
-
key:
|
|
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((
|
|
58
|
-
}),
|
|
59
|
-
!
|
|
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
|
-
|
|
63
|
+
e();
|
|
64
64
|
});
|
|
65
65
|
});
|
|
66
|
-
const
|
|
66
|
+
const a = F(() => {
|
|
67
67
|
var o;
|
|
68
|
-
return
|
|
69
|
-
}),
|
|
70
|
-
o.checked = t ||
|
|
71
|
-
|
|
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
|
-
|
|
76
|
-
}, 100),
|
|
75
|
+
e();
|
|
76
|
+
}, 100), I(() => {
|
|
77
77
|
var o;
|
|
78
|
-
return (o =
|
|
78
|
+
return (o = f.table) == null ? void 0 : o.key;
|
|
79
79
|
}, () => {
|
|
80
|
-
|
|
81
|
-
await M(
|
|
82
|
-
|
|
80
|
+
E(async () => {
|
|
81
|
+
await M(b.value, d.value), setTimeout(() => {
|
|
82
|
+
e();
|
|
83
83
|
});
|
|
84
84
|
});
|
|
85
85
|
}, {
|
|
86
86
|
immediate: !0
|
|
87
|
-
}),
|
|
88
|
-
|
|
89
|
-
|
|
87
|
+
}), I(d, () => {
|
|
88
|
+
E(() => {
|
|
89
|
+
g.value = W(d.value);
|
|
90
90
|
});
|
|
91
91
|
}, {
|
|
92
92
|
deep: !0
|
|
93
93
|
}), {
|
|
94
|
-
getSetting:
|
|
95
|
-
tableColumns:
|
|
96
|
-
checkTree:
|
|
97
|
-
defaultCheckedKeys:
|
|
98
|
-
resizeTaleHeightFn:
|
|
99
|
-
nodeDragEnd:
|
|
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:
|
|
103
|
-
isFooter:
|
|
104
|
-
headerList:
|
|
101
|
+
onlyClass: T,
|
|
102
|
+
isAllData: g,
|
|
103
|
+
isFooter: f.footer,
|
|
104
|
+
headerList: z,
|
|
105
105
|
tableRef: c,
|
|
106
|
-
headerRef:
|
|
107
|
-
headerFooterRef:
|
|
108
|
-
headerTitleRef:
|
|
109
|
-
bodyRef:
|
|
110
|
-
footerRef:
|
|
111
|
-
selectTableRef:
|
|
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,
|
|
116
|
-
const
|
|
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
|
|
120
|
-
return (
|
|
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
|
|
124
|
-
return (
|
|
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 : [],
|
|
127
|
-
return
|
|
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"] &&
|
|
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)]),
|
|
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
|
-
}, [
|
|
139
|
+
}, [l("div", {
|
|
140
140
|
class: "dinert-table-header-left"
|
|
141
141
|
}, [R.map((e) => {
|
|
142
|
-
var
|
|
142
|
+
var n, u;
|
|
143
143
|
if (this.$slots["header_left_" + e.key])
|
|
144
|
-
return (
|
|
145
|
-
const
|
|
146
|
-
return typeof e.show != "function" && [!0, void 0].includes(e.show) || typeof e.show == "function" && [!0, void 0].includes(e.show(e)) ?
|
|
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:
|
|
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 &&
|
|
155
|
+
})]), this.getSetting && l("div", {
|
|
156
156
|
class: "dinert-table-header-right"
|
|
157
|
-
}, [
|
|
158
|
-
default: () => [
|
|
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: () => [
|
|
166
|
-
}),
|
|
165
|
+
default: () => [j("全部显示")]
|
|
166
|
+
}), l(i("el-popover"), {
|
|
167
167
|
teleported: !1
|
|
168
168
|
}, {
|
|
169
|
-
default: () =>
|
|
169
|
+
default: () => l("ul", {
|
|
170
170
|
class: "dinert-popover-classify"
|
|
171
|
-
}, [
|
|
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,
|
|
182
|
-
onNodeDragEnd: (e,
|
|
183
|
-
const
|
|
184
|
-
e.data.sort =
|
|
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
|
-
}) =>
|
|
189
|
+
}) => l("div", {
|
|
190
190
|
class: "text-dot tree-item"
|
|
191
|
-
}, [
|
|
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: () =>
|
|
196
|
+
default: () => l("span", null, [e.label])
|
|
197
197
|
})])
|
|
198
198
|
})]),
|
|
199
|
-
reference: () =>
|
|
199
|
+
reference: () => l(i("el-button"), {
|
|
200
200
|
type: this.isAllData ? "" : "primary"
|
|
201
201
|
}, {
|
|
202
|
-
default: () => [
|
|
203
|
-
default: () => [
|
|
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"] &&
|
|
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
|
-
}, [(
|
|
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"] ? (
|
|
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": (
|
|
224
|
+
"row-key": (m = this.table) == null ? void 0 : m.rowKey
|
|
225
225
|
}), {
|
|
226
226
|
default: () => {
|
|
227
|
-
var e,
|
|
228
|
-
return [((e = this.table) == null ? void 0 : e.rowSelection) &&
|
|
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), ((
|
|
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),
|
|
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: (
|
|
244
|
-
},
|
|
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,
|
|
248
|
-
return (
|
|
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,
|
|
252
|
-
return (
|
|
251
|
+
var e, a;
|
|
252
|
+
return (a = (e = this.$slots)["table-append"]) == null ? void 0 : a.call(e);
|
|
253
253
|
} : null
|
|
254
|
-
})]), this.isFooter && ((
|
|
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
|
-
}, [
|
|
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
|
-
}, (
|
|
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
|
-
|
|
277
|
+
pe as default
|
|
274
278
|
};
|
|
275
279
|
//# sourceMappingURL=index.mjs.map
|