@dinert/element-plus 1.0.0 → 1.0.1
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 -0
- package/dist/element-plus.umd.js.map +1 -0
- package/dist/style.css +1 -0
- package/es/node_modules/@element-plus/icons-vue/dist/index.mjs +95 -0
- package/es/node_modules/@element-plus/icons-vue/dist/index.mjs.map +1 -0
- package/es/packages/assets/scss/dinert-form.scss.mjs +5 -0
- package/es/packages/assets/scss/dinert-form.scss.mjs.map +1 -0
- package/es/packages/assets/scss/dinert-table-page.scss.mjs +5 -0
- package/es/packages/assets/scss/dinert-table-page.scss.mjs.map +1 -0
- package/es/packages/assets/scss/dinert-table.scss.mjs +5 -0
- package/es/packages/assets/scss/dinert-table.scss.mjs.map +1 -0
- package/es/packages/assets/scss/dinert-tooltip.scss.mjs +5 -0
- package/es/packages/assets/scss/dinert-tooltip.scss.mjs.map +1 -0
- package/es/packages/components/form/index.mjs +10 -0
- package/es/packages/components/form/index.mjs.map +1 -0
- package/es/packages/components/form/src/cascader.mjs +49 -0
- package/es/packages/components/form/src/cascader.mjs.map +1 -0
- package/es/packages/components/form/src/checkbox.mjs +44 -0
- package/es/packages/components/form/src/checkbox.mjs.map +1 -0
- package/es/packages/components/form/src/date.mjs +46 -0
- package/es/packages/components/form/src/date.mjs.map +1 -0
- package/es/packages/components/form/src/index.mjs +229 -0
- package/es/packages/components/form/src/index.mjs.map +1 -0
- package/es/packages/components/form/src/input-autocomplete.mjs +35 -0
- package/es/packages/components/form/src/input-autocomplete.mjs.map +1 -0
- package/es/packages/components/form/src/input-number.mjs +39 -0
- package/es/packages/components/form/src/input-number.mjs.map +1 -0
- package/es/packages/components/form/src/input.mjs +43 -0
- package/es/packages/components/form/src/input.mjs.map +1 -0
- package/es/packages/components/form/src/radio.mjs +43 -0
- package/es/packages/components/form/src/radio.mjs.map +1 -0
- package/es/packages/components/form/src/rate.mjs +35 -0
- package/es/packages/components/form/src/rate.mjs.map +1 -0
- package/es/packages/components/form/src/select.mjs +45 -0
- package/es/packages/components/form/src/select.mjs.map +1 -0
- package/es/packages/components/form/src/switch.mjs +36 -0
- package/es/packages/components/form/src/switch.mjs.map +1 -0
- package/es/packages/components/form/src/tree-select.mjs +43 -0
- package/es/packages/components/form/src/tree-select.mjs.map +1 -0
- package/es/packages/components/form/utils/index.mjs +44 -0
- package/es/packages/components/form/utils/index.mjs.map +1 -0
- package/es/packages/components/index.mjs +11 -0
- package/es/packages/components/index.mjs.map +1 -0
- package/es/packages/components/table/hooks/index.mjs +30 -0
- package/es/packages/components/table/hooks/index.mjs.map +1 -0
- package/es/packages/components/table/index.mjs +10 -0
- package/es/packages/components/table/index.mjs.map +1 -0
- package/es/packages/components/table/src/index.mjs +177 -0
- package/es/packages/components/table/src/index.mjs.map +1 -0
- package/es/packages/components/table/src/recuve-table-column.mjs +235 -0
- package/es/packages/components/table/src/recuve-table-column.mjs.map +1 -0
- package/es/packages/components/table-page/index.mjs +10 -0
- package/es/packages/components/table-page/index.mjs.map +1 -0
- package/es/packages/components/table-page/src/index.mjs +76 -0
- package/es/packages/components/table-page/src/index.mjs.map +1 -0
- package/es/packages/components/tooltip/index.mjs +10 -0
- package/es/packages/components/tooltip/index.mjs.map +1 -0
- package/es/packages/components/tooltip/src/index.mjs +56 -0
- package/es/packages/components/tooltip/src/index.mjs.map +1 -0
- package/es/packages/hooks/useTablePage/index.mjs +111 -0
- package/es/packages/hooks/useTablePage/index.mjs.map +1 -0
- package/es/packages/hooks/useWindowResize.mjs +16 -0
- package/es/packages/hooks/useWindowResize.mjs.map +1 -0
- package/es/packages/index.mjs +21 -0
- package/es/packages/index.mjs.map +1 -0
- package/es/packages/utils/tools.mjs +54 -0
- package/es/packages/utils/tools.mjs.map +1 -0
- package/es/src/components/form/index.d.ts +32 -0
- package/es/src/components/form/src/checkbox.d.ts +28 -0
- package/es/src/components/form/src/date.d.ts +28 -0
- package/es/src/components/form/src/index.d.ts +32 -0
- package/es/src/components/form/src/input-autocomplete.d.ts +28 -0
- package/es/src/components/form/src/input-number.d.ts +28 -0
- package/es/src/components/form/src/input.d.ts +28 -0
- package/es/src/components/form/src/radio.d.ts +28 -0
- package/es/src/components/form/src/rate.d.ts +28 -0
- package/es/src/components/form/src/switch.d.ts +28 -0
- package/es/src/components/form/src/tree-select.d.ts +39 -0
- package/es/src/components/form/types/index.d.ts +41 -0
- package/es/src/components/form/utils/index.d.ts +5 -0
- package/es/src/components/index.d.ts +7 -0
- package/es/src/components/table/hooks/index.d.ts +14 -0
- package/es/src/components/table/index.d.ts +709 -0
- package/es/src/components/table/src/index.d.ts +711 -0
- package/es/src/components/table/src/recuve-table-column.d.ts +43 -0
- package/es/src/components/table/types/index.d.ts +81 -0
- package/es/src/components/table-page/index.d.ts +1604 -0
- package/es/src/components/table-page/src/index.d.ts +1605 -0
- package/es/src/components/tooltip/index.d.ts +60 -0
- package/es/src/components/tooltip/src/index.d.ts +59 -0
- package/es/src/components/tooltip/types/index.d.ts +10 -0
- package/es/src/hooks/useTablePage/index.d.ts +47 -0
- package/es/src/hooks/useTablePage/types/index.d.ts +29 -0
- package/es/src/hooks/useWindowResize.d.ts +2 -0
- package/es/src/index.d.ts +6 -0
- package/es/src/utils/tools.d.ts +19 -0
- package/es/src/views/test-table/data.d.ts +21 -0
- package/es/src/views/test-table/tableColumns.d.ts +9 -0
- package/es/src/views/test-table-page/data.d.ts +2 -0
- package/es/src/views/test-table-page/formItem.d.ts +1 -0
- package/es/src/views/test-table-page/tableColumns.d.ts +27 -0
- package/es/src/views/test-table-page/types/index.d.ts +23 -0
- package/es/style.css +1 -0
- package/lib/index.js +2 -0
- package/lib/index.js.map +1 -0
- package/lib/src/components/form/index.d.ts +32 -0
- package/lib/src/components/form/src/checkbox.d.ts +28 -0
- package/lib/src/components/form/src/date.d.ts +28 -0
- package/lib/src/components/form/src/index.d.ts +32 -0
- package/lib/src/components/form/src/input-autocomplete.d.ts +28 -0
- package/lib/src/components/form/src/input-number.d.ts +28 -0
- package/lib/src/components/form/src/input.d.ts +28 -0
- package/lib/src/components/form/src/radio.d.ts +28 -0
- package/lib/src/components/form/src/rate.d.ts +28 -0
- package/lib/src/components/form/src/switch.d.ts +28 -0
- package/lib/src/components/form/src/tree-select.d.ts +39 -0
- package/lib/src/components/form/types/index.d.ts +41 -0
- package/lib/src/components/form/utils/index.d.ts +5 -0
- package/lib/src/components/index.d.ts +7 -0
- package/lib/src/components/table/hooks/index.d.ts +14 -0
- package/lib/src/components/table/index.d.ts +709 -0
- package/lib/src/components/table/src/index.d.ts +711 -0
- package/lib/src/components/table/src/recuve-table-column.d.ts +43 -0
- package/lib/src/components/table/types/index.d.ts +81 -0
- package/lib/src/components/table-page/index.d.ts +1604 -0
- package/lib/src/components/table-page/src/index.d.ts +1605 -0
- package/lib/src/components/tooltip/index.d.ts +60 -0
- package/lib/src/components/tooltip/src/index.d.ts +59 -0
- package/lib/src/components/tooltip/types/index.d.ts +10 -0
- package/lib/src/hooks/useTablePage/index.d.ts +47 -0
- package/lib/src/hooks/useTablePage/types/index.d.ts +29 -0
- package/lib/src/hooks/useWindowResize.d.ts +2 -0
- package/lib/src/index.d.ts +6 -0
- package/lib/src/utils/tools.d.ts +19 -0
- package/lib/src/views/test-table/data.d.ts +21 -0
- package/lib/src/views/test-table/tableColumns.d.ts +9 -0
- package/lib/src/views/test-table-page/data.d.ts +2 -0
- package/lib/src/views/test-table-page/formItem.d.ts +1 -0
- package/lib/src/views/test-table-page/tableColumns.d.ts +27 -0
- package/lib/src/views/test-table-page/types/index.d.ts +23 -0
- package/lib/style.css +1 -0
- package/package.json +1 -1
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { defineComponent as i, computed as m, createVNode as p, resolveComponent as l, mergeProps as u } from "vue";
|
|
2
|
+
import { customPlaceholder as h } from "../utils/index.mjs";
|
|
3
|
+
const f = /* @__PURE__ */ i({
|
|
4
|
+
name: "dinert-input",
|
|
5
|
+
props: {
|
|
6
|
+
form: {
|
|
7
|
+
type: Object,
|
|
8
|
+
default: () => ({})
|
|
9
|
+
},
|
|
10
|
+
formItem: {
|
|
11
|
+
type: Object,
|
|
12
|
+
default: () => ({})
|
|
13
|
+
}
|
|
14
|
+
},
|
|
15
|
+
setup(o) {
|
|
16
|
+
return {
|
|
17
|
+
options: m(() => {
|
|
18
|
+
const t = o.formItem.options || {};
|
|
19
|
+
return t.type = o.formItem.type, t;
|
|
20
|
+
})
|
|
21
|
+
};
|
|
22
|
+
},
|
|
23
|
+
render() {
|
|
24
|
+
var o, e, t, n, s;
|
|
25
|
+
return p(l("el-input"), u({
|
|
26
|
+
modelValue: this.form.model[this.formItem.key],
|
|
27
|
+
"onUpdate:modelValue": (r) => this.form.model[this.formItem.key] = r,
|
|
28
|
+
clearable: !0,
|
|
29
|
+
"show-word-limit": this.options.showWordLimit ? !0 : this.options.showWordLimit,
|
|
30
|
+
placeholder: h(this.formItem.label)
|
|
31
|
+
}, this.options, {
|
|
32
|
+
onChange: (o = this.options.on) == null ? void 0 : o.onChange,
|
|
33
|
+
onFocus: (e = this.options.on) == null ? void 0 : e.onFocus,
|
|
34
|
+
onBlur: (t = this.options.on) == null ? void 0 : t.onBlur,
|
|
35
|
+
onClear: (n = this.options.on) == null ? void 0 : n.onClear,
|
|
36
|
+
onInput: (s = this.options.on) == null ? void 0 : s.onInput
|
|
37
|
+
}), this.$slots);
|
|
38
|
+
}
|
|
39
|
+
});
|
|
40
|
+
export {
|
|
41
|
+
f as default
|
|
42
|
+
};
|
|
43
|
+
//# sourceMappingURL=input.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"input.mjs","sources":["../../../../../packages/components/form/src/input.tsx"],"sourcesContent":["import {computed, defineComponent} from 'vue'\r\nimport {customPlaceholder} from '../utils'\r\n\r\nimport type {RewriteFormProps, CustomFormItemProps} from '@/components/form/types'\r\nimport type {PropType} from 'vue'\r\nimport type {InputProps} from 'element-plus'\r\n\r\n\r\nexport default defineComponent({\r\n name: 'dinert-input',\r\n props: {\r\n form: {\r\n type: Object as PropType<RewriteFormProps>,\r\n default: () => ({})\r\n },\r\n formItem: {\r\n type: Object as PropType<CustomFormItemProps<Partial<InputProps>, any>>,\r\n default: () => ({})\r\n },\r\n },\r\n setup(props) {\r\n const options = computed(() => {\r\n const options = props.formItem.options || {};\r\n (options).type = props.formItem.type\r\n return options\r\n })\r\n\r\n\r\n return {\r\n options,\r\n }\r\n },\r\n render() {\r\n return (\r\n <el-input\r\n v-model={this.form.model[this.formItem.key]}\r\n clearable\r\n show-word-limit={this.options.showWordLimit ? true : this.options.showWordLimit}\r\n placeholder={customPlaceholder(this.formItem.label)}\r\n {...this.options}\r\n onChange={this.options.on?.onChange}\r\n onFocus={this.options.on?.onFocus}\r\n onBlur={this.options.on?.onBlur}\r\n onClear={this.options.on?.onClear}\r\n onInput={this.options.on?.onInput}\r\n v-slots={this.$slots}\r\n >\r\n </el-input>\r\n )\r\n }\r\n})\r\n\r\n"],"names":["defineComponent","name","props","form","type","Object","default","formItem","setup","options","computed","render","_createVNode","_resolveComponent","_mergeProps","model","key","$event","showWordLimit","customPlaceholder","label","_a","on","onChange","_b","onFocus","_c","onBlur","_d","onClear","_e","onInput","$slots"],"mappings":";;AAQA,MAAeA,sBAAgB;AAAA,EAC3BC,MAAM;AAAA,EACNC,OAAO;AAAA,IACHC,MAAM;AAAA,MACFC,MAAMC;AAAAA,MACNC,SAASA,OAAO,CAAA;AAAA,IACnB;AAAA,IACDC,UAAU;AAAA,MACNH,MAAMC;AAAAA,MACNC,SAASA,OAAO,CAAA;AAAA,IACpB;AAAA,EACH;AAAA,EACDE,MAAMN,GAAO;AAQT,WAAO;AAAA,MACHO,SARYC,EAAS,MAAM;AAC3B,cAAMD,IAAUP,EAAMK,SAASE,WAAW,CAAA;AACzCA,eAAAA,EAASL,OAAOF,EAAMK,SAASH,MACzBK;AAAAA,MACX,CAAC;AAAA;EAMJ;AAAA,EACDE,SAAS;;AACL,WAAAC,EAAAC,EAAA,UAAA,GAAAC,EAAA;AAAA,MAAA,YAEiB,KAAKX,KAAKY,MAAM,KAAKR,SAASS,GAAG;AAAA,MAAC,uBAAAC,CAAAA,MAAlC,KAAKd,KAAKY,MAAM,KAAKR,SAASS,GAAG,IAACC;AAAAA,MAAA,WAAA;AAAA,MAAA,mBAE1B,KAAKR,QAAQS,gBAAgB,KAAO,KAAKT,QAAQS;AAAAA,MAAa,aAClEC,EAAkB,KAAKZ,SAASa,KAAK;AAAA,OAC9C,KAAKX,SAAO;AAAA,MAAA,WACNY,IAAA,KAAKZ,QAAQa,OAAb,gBAAAD,EAAiBE;AAAAA,MAAQ,UAC1BC,IAAA,KAAKf,QAAQa,OAAb,gBAAAE,EAAiBC;AAAAA,MAAO,SACzBC,IAAA,KAAKjB,QAAQa,OAAb,gBAAAI,EAAiBC;AAAAA,MAAM,UACtBC,IAAA,KAAKnB,QAAQa,OAAb,gBAAAM,EAAiBC;AAAAA,MAAO,UACxBC,IAAA,KAAKrB,QAAQa,OAAb,gBAAAQ,EAAiBC;AAAAA,KACjB,GAAA,KAAKC,MAAM;AAAA,EAIhC;AACJ,CAAC;"}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { defineComponent as s, computed as i, createVNode as n, resolveComponent as r, mergeProps as p, isVNode as l } from "vue";
|
|
2
|
+
function m(o) {
|
|
3
|
+
return typeof o == "function" || Object.prototype.toString.call(o) === "[object Object]" && !l(o);
|
|
4
|
+
}
|
|
5
|
+
const d = /* @__PURE__ */ s({
|
|
6
|
+
name: "dinert-radio",
|
|
7
|
+
props: {
|
|
8
|
+
form: {
|
|
9
|
+
type: Object,
|
|
10
|
+
default: () => ({})
|
|
11
|
+
},
|
|
12
|
+
formItem: {
|
|
13
|
+
type: Object,
|
|
14
|
+
default: () => ({})
|
|
15
|
+
}
|
|
16
|
+
},
|
|
17
|
+
setup(o) {
|
|
18
|
+
return {
|
|
19
|
+
options: i(() => o.formItem.options || {
|
|
20
|
+
on: {}
|
|
21
|
+
})
|
|
22
|
+
};
|
|
23
|
+
},
|
|
24
|
+
render() {
|
|
25
|
+
let o;
|
|
26
|
+
const e = this.options.options || [];
|
|
27
|
+
return n(r("el-radio-group"), {
|
|
28
|
+
modelValue: this.form.model[this.formItem.key],
|
|
29
|
+
"onUpdate:modelValue": (t) => this.form.model[this.formItem.key] = t
|
|
30
|
+
}, m(o = e.map((t) => n(r("el-radio"), p({
|
|
31
|
+
label: t.value
|
|
32
|
+
}, this.options.on), {
|
|
33
|
+
default: () => [t.label],
|
|
34
|
+
...this.$slots
|
|
35
|
+
}))) ? o : {
|
|
36
|
+
default: () => [o]
|
|
37
|
+
});
|
|
38
|
+
}
|
|
39
|
+
});
|
|
40
|
+
export {
|
|
41
|
+
d as default
|
|
42
|
+
};
|
|
43
|
+
//# sourceMappingURL=radio.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"radio.mjs","sources":["../../../../../packages/components/form/src/radio.tsx"],"sourcesContent":["import {computed, defineComponent} from 'vue'\r\n\r\nimport type {RewriteFormProps, CustomFormItemProps} from '@/components/form/types'\r\nimport type {PropType} from 'vue'\r\nimport type {RadioProps} from 'element-plus'\r\n\r\n\r\nexport default defineComponent({\r\n name: 'dinert-radio',\r\n props: {\r\n form: {\r\n type: Object as PropType<RewriteFormProps>,\r\n default: () => ({})\r\n },\r\n formItem: {\r\n type: Object as PropType<CustomFormItemProps<Partial<RadioProps>>>,\r\n default: () => ({})\r\n },\r\n },\r\n setup(props) {\r\n\r\n const options = computed(() => {\r\n const options = props.formItem.options || {on: {}}\r\n return options\r\n })\r\n\r\n return {\r\n options\r\n }\r\n },\r\n render() {\r\n const options = this.options.options || []\r\n\r\n return (\r\n <el-radio-group v-model={this.form.model[this.formItem.key]}>\r\n {\r\n (options as any[]).map((item: RadioProps & {value: any}) => {\r\n return (<el-radio\r\n label={item.value}\r\n {...this.options.on}\r\n v-slots={this.$slots}\r\n >\r\n {item.label}\r\n </el-radio>)\r\n })\r\n }\r\n\r\n </el-radio-group>\r\n )\r\n }\r\n})\r\n\r\n"],"names":["_isSlot","s","Object","prototype","toString","call","_isVNode","defineComponent","name","props","form","type","default","formItem","setup","options","computed","on","render","_slot","_createVNode","_resolveComponent","model","key","$event","map","item","_mergeProps","value","label","$slots"],"mappings":";AAA6C,SAAAA,EAAAC,GAAA;AAAA,SAAA,OAAAA,KAAA,cAAAC,OAAAC,UAAAC,SAAAC,KAAAJ,CAAA,MAAAK,qBAAAA,CAAAA,EAAAL,CAAA;AAAA;AAO7C,MAAeM,sBAAgB;AAAA,EAC3BC,MAAM;AAAA,EACNC,OAAO;AAAA,IACHC,MAAM;AAAA,MACFC,MAAMT;AAAAA,MACNU,SAASA,OAAO,CAAA;AAAA,IACnB;AAAA,IACDC,UAAU;AAAA,MACNF,MAAMT;AAAAA,MACNU,SAASA,OAAO,CAAA;AAAA,IACpB;AAAA,EACH;AAAA,EACDE,MAAML,GAAO;AAOT,WAAO;AAAA,MACHM,SANYC,EAAS,MACLP,EAAMI,SAASE,WAAW;AAAA,QAACE,IAAI,CAAC;AAAA,OAEnD;AAAA;EAKJ;AAAA,EACDC,SAAS;AAAA,QAAAC;AACL,UAAMJ,IAAU,KAAKA,QAAQA,WAAW,CAAA;AAExC,WAAAK,EAAAC,EAAA,gBAAA,GAAA;AAAA,MAAA,YAC6B,KAAKX,KAAKY,MAAM,KAAKT,SAASU,GAAG;AAAA,MAAC,uBAAAC,CAAAA,MAAlC,KAAKd,KAAKY,MAAM,KAAKT,SAASU,GAAG,IAACC;AAAAA,IAAAxB,GAAAA,EAAAmB,IAElDJ,EAAkBU,IAAKC,CAAAA,MACpBN,EAAAC,EAAA,UAAA,GAAAM,EAAA;AAAA,MAAA,OACWD,EAAKE;AAAAA,IAAK,GACb,KAAKb,QAAQE,EAAE,GAAA;AAAA,MAAAL,SAAAA,MAGlBc,CAAAA,EAAKG,KAAK;AAAA,MAAA,GAFF,KAAKC;AAAAA,IAAM,CAAA,CAI3B,CAAC,IAAAX,IAAA;AAAA,MAAAP,SAAAA,MAAA,CAAAO,CAAA;AAAA,IAAA,CAAA;AAAA,EAKlB;AACJ,CAAC;"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { defineComponent as n, computed as r, createVNode as m, resolveComponent as s, mergeProps as p } from "vue";
|
|
2
|
+
const a = /* @__PURE__ */ n({
|
|
3
|
+
name: "dinert-rate",
|
|
4
|
+
props: {
|
|
5
|
+
form: {
|
|
6
|
+
type: Object,
|
|
7
|
+
default: () => ({})
|
|
8
|
+
},
|
|
9
|
+
formItem: {
|
|
10
|
+
type: Object,
|
|
11
|
+
default: () => ({})
|
|
12
|
+
}
|
|
13
|
+
},
|
|
14
|
+
setup(e) {
|
|
15
|
+
return {
|
|
16
|
+
options: r(() => {
|
|
17
|
+
const o = e.formItem.options || {};
|
|
18
|
+
return o.type = e.formItem.type, o;
|
|
19
|
+
})
|
|
20
|
+
};
|
|
21
|
+
},
|
|
22
|
+
render() {
|
|
23
|
+
var e;
|
|
24
|
+
return m(s("el-rate"), p({
|
|
25
|
+
modelValue: this.form.model[this.formItem.key],
|
|
26
|
+
"onUpdate:modelValue": (t) => this.form.model[this.formItem.key] = t
|
|
27
|
+
}, this.options, {
|
|
28
|
+
onChange: (e = this.options.on) == null ? void 0 : e.onChange
|
|
29
|
+
}), this.$slots);
|
|
30
|
+
}
|
|
31
|
+
});
|
|
32
|
+
export {
|
|
33
|
+
a as default
|
|
34
|
+
};
|
|
35
|
+
//# sourceMappingURL=rate.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"rate.mjs","sources":["../../../../../packages/components/form/src/rate.tsx"],"sourcesContent":["import {computed, defineComponent, PropType} from 'vue'\r\n\r\nimport type {RewriteFormProps, CustomFormItemProps} from '@/components/form/types'\r\nimport type {RateProps} from 'element-plus'\r\n\r\n\r\nexport default defineComponent({\r\n name: 'dinert-rate',\r\n props: {\r\n form: {\r\n type: Object as PropType<RewriteFormProps>,\r\n default: () => ({})\r\n },\r\n formItem: {\r\n type: Object as PropType<CustomFormItemProps<Partial<RateProps>, any>>,\r\n default: () => ({})\r\n },\r\n },\r\n setup(props) {\r\n const options = computed(() => {\r\n const options = props.formItem.options || {};\r\n (options).type = props.formItem.type\r\n return options\r\n })\r\n\r\n\r\n return {\r\n options,\r\n }\r\n },\r\n render() {\r\n return (\r\n <el-rate\r\n v-model={this.form.model[this.formItem.key]}\r\n {...this.options}\r\n onChange={this.options.on?.onChange}\r\n v-slots={this.$slots}\r\n >\r\n </el-rate>\r\n )\r\n }\r\n})\r\n\r\n"],"names":["defineComponent","name","props","form","type","Object","default","formItem","setup","options","computed","render","_createVNode","_resolveComponent","_mergeProps","model","key","$event","_a","on","onChange","$slots"],"mappings":";AAMA,MAAeA,sBAAgB;AAAA,EAC3BC,MAAM;AAAA,EACNC,OAAO;AAAA,IACHC,MAAM;AAAA,MACFC,MAAMC;AAAAA,MACNC,SAASA,OAAO,CAAA;AAAA,IACnB;AAAA,IACDC,UAAU;AAAA,MACNH,MAAMC;AAAAA,MACNC,SAASA,OAAO,CAAA;AAAA,IACpB;AAAA,EACH;AAAA,EACDE,MAAMN,GAAO;AAQT,WAAO;AAAA,MACHO,SARYC,EAAS,MAAM;AAC3B,cAAMD,IAAUP,EAAMK,SAASE,WAAW,CAAA;AACzCA,eAAAA,EAASL,OAAOF,EAAMK,SAASH,MACzBK;AAAAA,MACX,CAAC;AAAA;EAMJ;AAAA,EACDE,SAAS;;AACL,WAAAC,EAAAC,EAAA,SAAA,GAAAC,EAAA;AAAA,MAAA,YAEiB,KAAKX,KAAKY,MAAM,KAAKR,SAASS,GAAG;AAAA,MAAC,uBAAAC,CAAAA,MAAlC,KAAKd,KAAKY,MAAM,KAAKR,SAASS,GAAG,IAACC;AAAAA,OACvC,KAAKR,SAAO;AAAA,MAAA,WACNS,IAAA,KAAKT,QAAQU,OAAb,gBAAAD,EAAiBE;AAAAA,KAClB,GAAA,KAAKC,MAAM;AAAA,EAIhC;AACJ,CAAC;"}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { defineComponent as r, computed as n, createVNode as t, resolveComponent as s, mergeProps as l } from "vue";
|
|
2
|
+
import { customPlaceholder as p } from "../utils/index.mjs";
|
|
3
|
+
const u = /* @__PURE__ */ r({
|
|
4
|
+
name: "dinert-select",
|
|
5
|
+
props: {
|
|
6
|
+
form: {
|
|
7
|
+
type: Object,
|
|
8
|
+
default: () => ({})
|
|
9
|
+
},
|
|
10
|
+
formItem: {
|
|
11
|
+
type: Object,
|
|
12
|
+
default: () => ({})
|
|
13
|
+
}
|
|
14
|
+
},
|
|
15
|
+
setup(o) {
|
|
16
|
+
return {
|
|
17
|
+
options: n(() => o.formItem.options || {
|
|
18
|
+
on: {}
|
|
19
|
+
})
|
|
20
|
+
};
|
|
21
|
+
},
|
|
22
|
+
render() {
|
|
23
|
+
const o = this.options.options || [];
|
|
24
|
+
return t(s("el-select"), l({
|
|
25
|
+
modelValue: this.form.model[this.formItem.key],
|
|
26
|
+
"onUpdate:modelValue": (e) => this.form.model[this.formItem.key] = e,
|
|
27
|
+
clearable: !0,
|
|
28
|
+
placeholder: p(this.formItem.label, "select")
|
|
29
|
+
}, this.options, this.options.on, {
|
|
30
|
+
key: this.formItem.key
|
|
31
|
+
}), {
|
|
32
|
+
default: () => [o.map((e) => t(s("el-option"), l({
|
|
33
|
+
key: e.value
|
|
34
|
+
}, e, {
|
|
35
|
+
label: e[this.options.label] || e.label,
|
|
36
|
+
value: e[this.options.value] || e.value
|
|
37
|
+
}), null))],
|
|
38
|
+
...this.$slots
|
|
39
|
+
});
|
|
40
|
+
}
|
|
41
|
+
});
|
|
42
|
+
export {
|
|
43
|
+
u as default
|
|
44
|
+
};
|
|
45
|
+
//# sourceMappingURL=select.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"select.mjs","sources":["../../../../../packages/components/form/src/select.tsx"],"sourcesContent":["import {computed, defineComponent} from 'vue'\r\nimport {customPlaceholder} from '../utils'\r\n\r\nimport type {RewriteFormProps, CustomFormItemProps} from '@/components/form/types'\r\nimport type {PropType} from 'vue'\r\nimport type {ElSelect, SelectOptionProxy} from 'element-plus'\r\n\r\nexport default defineComponent({\r\n name: 'dinert-select',\r\n props: {\r\n form: {\r\n type: Object as PropType<RewriteFormProps>,\r\n default: () => ({})\r\n },\r\n formItem: {\r\n type: Object as PropType<CustomFormItemProps<Partial<typeof ElSelect>, SelectOptionProxy[]>>,\r\n default: () => ({})\r\n },\r\n },\r\n setup(props) {\r\n\r\n const options = computed(() => {\r\n const options = props.formItem.options || {on: {}}\r\n return options\r\n })\r\n\r\n return {\r\n options,\r\n }\r\n },\r\n render() {\r\n const options = (this.options.options as SelectOptionProxy[]) || []\r\n return (\r\n <el-select\r\n v-model={this.form.model[this.formItem.key]}\r\n clearable\r\n placeholder={customPlaceholder(this.formItem.label, 'select')}\r\n\r\n {...this.options}\r\n {...this.options.on}\r\n v-slots={this.$slots}\r\n key={this.formItem.key}\r\n >\r\n {\r\n options.map((item: SelectOptionProxy) => {\r\n return (<el-option\r\n key={item.value}\r\n {...item}\r\n label={(item as any)[(this.options as any).label] || item.label}\r\n value={(item as any)[(this.options as any).value] || item.value}\r\n >\r\n </el-option>)\r\n })\r\n }\r\n </el-select>\r\n )\r\n }\r\n})\r\n\r\n"],"names":["defineComponent","name","props","form","type","Object","default","formItem","setup","options","computed","on","render","_createVNode","_resolveComponent","_mergeProps","model","key","$event","customPlaceholder","label","map","item","value","$slots"],"mappings":";;AAOA,MAAeA,sBAAgB;AAAA,EAC3BC,MAAM;AAAA,EACNC,OAAO;AAAA,IACHC,MAAM;AAAA,MACFC,MAAMC;AAAAA,MACNC,SAASA,OAAO,CAAA;AAAA,IACnB;AAAA,IACDC,UAAU;AAAA,MACNH,MAAMC;AAAAA,MACNC,SAASA,OAAO,CAAA;AAAA,IACpB;AAAA,EACH;AAAA,EACDE,MAAMN,GAAO;AAOT,WAAO;AAAA,MACHO,SANYC,EAAS,MACLR,EAAMK,SAASE,WAAW;AAAA,QAACE,IAAI,CAAC;AAAA,OAEnD;AAAA;EAKJ;AAAA,EACDC,SAAS;AACL,UAAMH,IAAW,KAAKA,QAAQA,WAAmC,CAAA;AACjE,WAAAI,EAAAC,EAAA,WAAA,GAAAC,EAAA;AAAA,MAAA,YAEiB,KAAKZ,KAAKa,MAAM,KAAKT,SAASU,GAAG;AAAA,MAAC,uBAAAC,CAAAA,MAAlC,KAAKf,KAAKa,MAAM,KAAKT,SAASU,GAAG,IAACC;AAAAA,MAAA,WAAA;AAAA,MAAA,aAE9BC,EAAkB,KAAKZ,SAASa,OAAO,QAAQ;AAAA,IAExD,GAAA,KAAKX,SACL,KAAKA,QAAQE,IAAE;AAAA,MAAA,KAEd,KAAKJ,SAASU;AAAAA,IAAG,CAAA,GAAA;AAAA,MAAAX,SAAAA,MAGlBG,CAAAA,EAAQY,IAAKC,CAAAA,MACTT,EAAAC,EAAA,WAAA,GAAAC,EAAA;AAAA,QAAA,KACSO,EAAKC;AAAAA,MAAK,GACXD,GAAI;AAAA,QAAA,OACAA,EAAc,KAAKb,QAAgBW,KAAK,KAAKE,EAAKF;AAAAA,QAAK,OACvDE,EAAc,KAAKb,QAAgBc,KAAK,KAAKD,EAAKC;AAAAA,MAAK,CAAA,GAAA,IAAA,CAGtE,CAAC;AAAA,MAAA,GAZG,KAAKC;AAAAA,IAAM,CAAA;AAAA,EAgBhC;AACJ,CAAC;"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { defineComponent as o, computed as s, createVNode as m, resolveComponent as n, mergeProps as r } from "vue";
|
|
2
|
+
const d = /* @__PURE__ */ o({
|
|
3
|
+
name: "dinert-switch",
|
|
4
|
+
props: {
|
|
5
|
+
form: {
|
|
6
|
+
type: Object,
|
|
7
|
+
default: () => ({})
|
|
8
|
+
},
|
|
9
|
+
formItem: {
|
|
10
|
+
type: Object,
|
|
11
|
+
default: () => ({})
|
|
12
|
+
}
|
|
13
|
+
},
|
|
14
|
+
setup(t) {
|
|
15
|
+
return {
|
|
16
|
+
options: s(() => {
|
|
17
|
+
const e = t.formItem.options || {
|
|
18
|
+
on: {}
|
|
19
|
+
};
|
|
20
|
+
return e.type = t.formItem.type, e;
|
|
21
|
+
})
|
|
22
|
+
};
|
|
23
|
+
},
|
|
24
|
+
render() {
|
|
25
|
+
return m(n("el-switch"), r({
|
|
26
|
+
modelValue: this.form.model[this.formItem.key],
|
|
27
|
+
"onUpdate:modelValue": (t) => this.form.model[this.formItem.key] = t
|
|
28
|
+
}, this.options, this.options.on, {
|
|
29
|
+
key: this.options.key
|
|
30
|
+
}), this.$slots);
|
|
31
|
+
}
|
|
32
|
+
});
|
|
33
|
+
export {
|
|
34
|
+
d as default
|
|
35
|
+
};
|
|
36
|
+
//# sourceMappingURL=switch.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"switch.mjs","sources":["../../../../../packages/components/form/src/switch.tsx"],"sourcesContent":["import {computed, defineComponent} from 'vue'\r\n\r\n\r\nimport type {RewriteFormProps, CustomFormItemProps} from '@/components/form/types'\r\nimport type {PropType} from 'vue'\r\nimport type {SwitchProps} from 'element-plus'\r\n\r\n\r\nexport default defineComponent({\r\n name: 'dinert-switch',\r\n props: {\r\n form: {\r\n type: Object as PropType<RewriteFormProps>,\r\n default: () => ({})\r\n },\r\n formItem: {\r\n type: Object as PropType<CustomFormItemProps<Partial<SwitchProps>>>,\r\n default: () => ({})\r\n },\r\n },\r\n setup(props) {\r\n\r\n const options = computed(() => {\r\n const options = props.formItem.options || {on: {}}\r\n options.type = props.formItem.type\r\n return options\r\n })\r\n\r\n return {\r\n options\r\n }\r\n },\r\n render() {\r\n return (\r\n <el-switch\r\n v-model={this.form.model[this.formItem.key]}\r\n {...this.options}\r\n {...this.options.on}\r\n v-slots={this.$slots}\r\n key={this.options.key}\r\n >\r\n </el-switch>\r\n )\r\n }\r\n})\r\n\r\n"],"names":["defineComponent","name","props","form","type","Object","default","formItem","setup","options","computed","on","render","_createVNode","_resolveComponent","_mergeProps","model","key","$event","$slots"],"mappings":";AAQA,MAAeA,sBAAgB;AAAA,EAC3BC,MAAM;AAAA,EACNC,OAAO;AAAA,IACHC,MAAM;AAAA,MACFC,MAAMC;AAAAA,MACNC,SAASA,OAAO,CAAA;AAAA,IACnB;AAAA,IACDC,UAAU;AAAA,MACNH,MAAMC;AAAAA,MACNC,SAASA,OAAO,CAAA;AAAA,IACpB;AAAA,EACH;AAAA,EACDE,MAAMN,GAAO;AAQT,WAAO;AAAA,MACHO,SAPYC,EAAS,MAAM;AAC3B,cAAMD,IAAUP,EAAMK,SAASE,WAAW;AAAA,UAACE,IAAI,CAAC;AAAA;AAChDF,eAAAA,EAAQL,OAAOF,EAAMK,SAASH,MACvBK;AAAAA,MACX,CAAC;AAAA;EAKJ;AAAA,EACDG,SAAS;AACL,WAAAC,EAAAC,EAAA,WAAA,GAAAC,EAAA;AAAA,MAAA,YAEiB,KAAKZ,KAAKa,MAAM,KAAKT,SAASU,GAAG;AAAA,MAAC,uBAAAC,CAAAA,MAAlC,KAAKf,KAAKa,MAAM,KAAKT,SAASU,GAAG,IAACC;AAAAA,IACvC,GAAA,KAAKT,SACL,KAAKA,QAAQE,IAAE;AAAA,MAAA,KAEd,KAAKF,QAAQQ;AAAAA,KADT,GAAA,KAAKE,MAAM;AAAA,EAKhC;AACJ,CAAC;"}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { defineComponent as o, computed as r, createVNode as s, resolveComponent as n, mergeProps as i } from "vue";
|
|
2
|
+
import { customPlaceholder as l } from "../utils/index.mjs";
|
|
3
|
+
const d = /* @__PURE__ */ o({
|
|
4
|
+
name: "dinert-tree-select",
|
|
5
|
+
props: {
|
|
6
|
+
form: {
|
|
7
|
+
type: Object,
|
|
8
|
+
default: () => ({})
|
|
9
|
+
},
|
|
10
|
+
formItem: {
|
|
11
|
+
type: Object,
|
|
12
|
+
default: () => ({})
|
|
13
|
+
}
|
|
14
|
+
},
|
|
15
|
+
setup(e) {
|
|
16
|
+
return {
|
|
17
|
+
options: r(() => {
|
|
18
|
+
const t = e.formItem.options || {
|
|
19
|
+
on: {},
|
|
20
|
+
options: [],
|
|
21
|
+
data: []
|
|
22
|
+
};
|
|
23
|
+
return t.data = t.options, t;
|
|
24
|
+
})
|
|
25
|
+
};
|
|
26
|
+
},
|
|
27
|
+
render() {
|
|
28
|
+
return s(n("el-tree-select"), i({
|
|
29
|
+
modelValue: this.form.model[this.formItem.key],
|
|
30
|
+
"onUpdate:modelValue": (e) => this.form.model[this.formItem.key] = e,
|
|
31
|
+
clearable: !0,
|
|
32
|
+
placeholder: l(this.formItem.label, "select"),
|
|
33
|
+
filterable: this.options.filterable === void 0 ? !0 : this.options.filterable,
|
|
34
|
+
"node-key": this.options.nodeKey
|
|
35
|
+
}, this.options, this.options.on, {
|
|
36
|
+
key: this.formItem.key
|
|
37
|
+
}), this.$slots);
|
|
38
|
+
}
|
|
39
|
+
});
|
|
40
|
+
export {
|
|
41
|
+
d as default
|
|
42
|
+
};
|
|
43
|
+
//# sourceMappingURL=tree-select.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tree-select.mjs","sources":["../../../../../packages/components/form/src/tree-select.tsx"],"sourcesContent":["import {computed, defineComponent} from 'vue'\r\nimport {customPlaceholder} from '../utils'\r\n\r\nimport type {RewriteFormProps, CustomFormItemProps} from '@/components/form/types'\r\nimport type {PropType} from 'vue'\r\nimport type {ElTreeSelect} from 'element-plus'\r\n\r\nexport default defineComponent({\r\n name: 'dinert-tree-select',\r\n props: {\r\n form: {\r\n type: Object as PropType<RewriteFormProps>,\r\n default: () => ({})\r\n },\r\n formItem: {\r\n type: Object as PropType<CustomFormItemProps<Partial<typeof ElTreeSelect>>>,\r\n default: () => ({})\r\n },\r\n },\r\n setup(props) {\r\n\r\n const options = computed(() => {\r\n const options = props.formItem.options || {on: {}, options: [], data: []}\r\n options.data = options.options\r\n return options\r\n })\r\n\r\n return {\r\n options\r\n }\r\n },\r\n render() {\r\n return (\r\n <el-tree-select\r\n v-model={this.form.model[this.formItem.key]}\r\n clearable\r\n placeholder={customPlaceholder(this.formItem.label, 'select')}\r\n filterable={this.options.filterable === undefined ? true : this.options.filterable}\r\n node-key={this.options.nodeKey}\r\n {...this.options}\r\n {...this.options.on}\r\n v-slots={this.$slots}\r\n key={this.formItem.key}\r\n >\r\n </el-tree-select>\r\n )\r\n }\r\n})\r\n\r\n"],"names":["defineComponent","name","props","form","type","Object","default","formItem","setup","options","computed","on","data","render","_createVNode","_resolveComponent","_mergeProps","model","key","$event","customPlaceholder","label","filterable","undefined","nodeKey","$slots"],"mappings":";;AAOA,MAAeA,sBAAgB;AAAA,EAC3BC,MAAM;AAAA,EACNC,OAAO;AAAA,IACHC,MAAM;AAAA,MACFC,MAAMC;AAAAA,MACNC,SAASA,OAAO,CAAA;AAAA,IACnB;AAAA,IACDC,UAAU;AAAA,MACNH,MAAMC;AAAAA,MACNC,SAASA,OAAO,CAAA;AAAA,IACpB;AAAA,EACH;AAAA,EACDE,MAAMN,GAAO;AAQT,WAAO;AAAA,MACHO,SAPYC,EAAS,MAAM;AAC3B,cAAMD,IAAUP,EAAMK,SAASE,WAAW;AAAA,UAACE,IAAI,CAAE;AAAA,UAAEF,SAAS,CAAE;AAAA,UAAEG,MAAM,CAAA;AAAA;AACtEH,eAAAA,EAAQG,OAAOH,EAAQA,SAChBA;AAAAA,MACX,CAAC;AAAA;EAKJ;AAAA,EACDI,SAAS;AACL,WAAAC,EAAAC,EAAA,gBAAA,GAAAC,EAAA;AAAA,MAAA,YAEiB,KAAKb,KAAKc,MAAM,KAAKV,SAASW,GAAG;AAAA,MAAC,uBAAAC,CAAAA,MAAlC,KAAKhB,KAAKc,MAAM,KAAKV,SAASW,GAAG,IAACC;AAAAA,MAAA,WAAA;AAAA,MAAA,aAE9BC,EAAkB,KAAKb,SAASc,OAAO,QAAQ;AAAA,MAAC,YACjD,KAAKZ,QAAQa,eAAeC,SAAY,KAAO,KAAKd,QAAQa;AAAAA,MAAU,YACxE,KAAKb,QAAQe;AAAAA,IACnB,GAAA,KAAKf,SACL,KAAKA,QAAQE,IAAE;AAAA,MAAA,KAEd,KAAKJ,SAASW;AAAAA,KADV,GAAA,KAAKO,MAAM;AAAA,EAKhC;AACJ,CAAC;"}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
const u = (t, e, l) => {
|
|
2
|
+
const o = t.target.parentElement.parentElement, r = window.getComputedStyle(o, null), n = e.rules ? 12 : e.beforeWidth || 0, s = parseInt(r.getPropertyValue("max-width")) - n - parseInt(r.getPropertyValue("padding-right"));
|
|
3
|
+
t.target.previousElementSibling.offsetWidth >= s ? l.form.formItem[e.key].labelDisabled = !1 : l.form.formItem[e.key].labelDisabled = !0;
|
|
4
|
+
}, d = (t, e) => {
|
|
5
|
+
const l = e.type, o = e.options;
|
|
6
|
+
if (["input"].includes(l))
|
|
7
|
+
return t;
|
|
8
|
+
if (["select"].includes(l) && o && o.options && o.options.length) {
|
|
9
|
+
const r = o.options.filter((n) => n.value === t)[0];
|
|
10
|
+
return r && r.label;
|
|
11
|
+
}
|
|
12
|
+
return null;
|
|
13
|
+
}, p = (t, e, l, o) => {
|
|
14
|
+
if (!l || e.showLabel) {
|
|
15
|
+
o.form.formItem[e.key].valueDisabled = !0;
|
|
16
|
+
return;
|
|
17
|
+
}
|
|
18
|
+
const r = t.target.parentElement.querySelector(".el-input__inner"), n = [
|
|
19
|
+
"datetime",
|
|
20
|
+
"date",
|
|
21
|
+
"week",
|
|
22
|
+
"month",
|
|
23
|
+
"year",
|
|
24
|
+
"datetimerange",
|
|
25
|
+
"daterange",
|
|
26
|
+
"monthrange",
|
|
27
|
+
"yearrange"
|
|
28
|
+
];
|
|
29
|
+
if (["switch", "radio"].includes(e.type))
|
|
30
|
+
o.form.formItem[e.key].valueDisabled = !0;
|
|
31
|
+
else if (r && !n.includes(e.type)) {
|
|
32
|
+
const s = window.getComputedStyle(r, null), a = r.offsetWidth - parseInt(s.getPropertyValue("padding-right")) - parseInt(s.getPropertyValue("padding-left"));
|
|
33
|
+
t.target.previousElementSibling.offsetWidth >= a ? o.form.formItem[e.key].valueDisabled = !1 : o.form.formItem[e.key].valueDisabled = !0;
|
|
34
|
+
} else
|
|
35
|
+
o.form.formItem[e.key].valueDisabled = !1;
|
|
36
|
+
}, f = (t, e = "input", l = "请输入") => (l = e === "select" ? "请选择" : l, l + (t || "")), c = (t, e = "formItem_") => e + (t || "");
|
|
37
|
+
export {
|
|
38
|
+
f as customPlaceholder,
|
|
39
|
+
c as formItemSlot,
|
|
40
|
+
d as getTooltipValue,
|
|
41
|
+
u as labelMouseEnter,
|
|
42
|
+
p as valueMouseEnter
|
|
43
|
+
};
|
|
44
|
+
//# sourceMappingURL=index.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.mjs","sources":["../../../../../packages/components/form/utils/index.ts"],"sourcesContent":["\r\nexport const labelMouseEnter = (e: MouseEvent, item: any, _this: any) => {\r\n const el = (e.target as any).parentElement.parentElement\r\n const labelEl = window.getComputedStyle(el, null)\r\n const isRequried = item.rules ? 12 : item.beforeWidth || 0\r\n const labelWidth\r\n = parseInt(labelEl.getPropertyValue('max-width')) - isRequried\r\n - parseInt(labelEl.getPropertyValue('padding-right'))\r\n const tooltipWidth = (e.target as any).previousElementSibling.offsetWidth\r\n if (tooltipWidth >= labelWidth) {\r\n _this.form.formItem[item.key].labelDisabled = false\r\n\r\n } else {\r\n _this.form.formItem[item.key].labelDisabled = true\r\n }\r\n}\r\n\r\nexport const getTooltipValue = (value: any, item: any): any => {\r\n const type = item.type\r\n const options = item.options\r\n if (['input'].includes(type)) {\r\n return value\r\n } else if (['select'].includes(type)) {\r\n if (options && options.options && options.options.length) {\r\n const item = options.options.filter((item: any) => item.value === value)[0]\r\n return item && item.label\r\n }\r\n\r\n }\r\n return null\r\n}\r\n\r\nexport const valueMouseEnter = (e: MouseEvent, item: any, value: any, _this: any) => {\r\n if (!value || item.showLabel) {\r\n _this.form.formItem[item.key].valueDisabled = true\r\n return\r\n }\r\n const el = (e.target as any).parentElement.querySelector('.el-input__inner') as HTMLElement\r\n const timer = [\r\n 'datetime',\r\n 'date',\r\n 'week',\r\n 'month',\r\n 'year',\r\n 'datetimerange',\r\n 'daterange',\r\n 'monthrange',\r\n 'yearrange',\r\n ]\r\n if (['switch', 'radio'].includes(item.type)) {\r\n _this.form.formItem[item.key].valueDisabled = true\r\n } else if (el && !timer.includes(item.type)) {\r\n const inputEl = window.getComputedStyle(el, null)\r\n const textWidth\r\n = el.offsetWidth\r\n - parseInt(inputEl.getPropertyValue('padding-right'))\r\n - parseInt(inputEl.getPropertyValue('padding-left'))\r\n const tooltipWidth = (e.target as any).previousElementSibling.offsetWidth\r\n if (tooltipWidth >= textWidth) {\r\n _this.form.formItem[item.key].valueDisabled = false\r\n } else {\r\n _this.form.formItem[item.key].valueDisabled = true\r\n\r\n }\r\n } else {\r\n _this.form.formItem[item.key].valueDisabled = false\r\n }\r\n}\r\n\r\nexport const customPlaceholder = (customName: any, type: string = 'input', name: string = '请输入') => {\r\n name = type === 'select' ? '请选择' : name\r\n return name + (customName || '')\r\n}\r\n\r\nexport const formItemSlot = (customName: any, name: string = 'formItem_') => {\r\n return name + (customName || '')\r\n}\r\n"],"names":["labelMouseEnter","e","item","_this","el","labelEl","isRequried","labelWidth","getTooltipValue","value","type","options","valueMouseEnter","timer","inputEl","textWidth","customPlaceholder","customName","name","formItemSlot"],"mappings":"AACO,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,IAAkB,CAACC,GAAYP,MAAmB;AAC3D,QAAMQ,IAAOR,EAAK,MACZS,IAAUT,EAAK;AACrB,MAAI,CAAC,OAAO,EAAE,SAASQ,CAAI;AAChB,WAAAD;MACA,CAAC,QAAQ,EAAE,SAASC,CAAI,KAC3BC,KAAWA,EAAQ,WAAWA,EAAQ,QAAQ,QAAQ;AAChDT,UAAAA,IAAOS,EAAQ,QAAQ,OAAO,CAACT,MAAcA,EAAK,UAAUO,CAAK,EAAE,CAAC;AAC1E,WAAOP,KAAQA,EAAK;AAAA,EACxB;AAGG,SAAA;AACX,GAEaU,IAAkB,CAACX,GAAeC,GAAWO,GAAYN,MAAe;AAC7E,MAAA,CAACM,KAASP,EAAK,WAAW;AAC1B,IAAAC,EAAM,KAAK,SAASD,EAAK,GAAG,EAAE,gBAAgB;AAC9C;AAAA,EACJ;AACA,QAAME,IAAMH,EAAE,OAAe,cAAc,cAAc,kBAAkB,GACrEY,IAAQ;AAAA,IACV;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EAAA;AAEJ,MAAI,CAAC,UAAU,OAAO,EAAE,SAASX,EAAK,IAAI;AACtC,IAAAC,EAAM,KAAK,SAASD,EAAK,GAAG,EAAE,gBAAgB;AAAA,WACvCE,KAAM,CAACS,EAAM,SAASX,EAAK,IAAI,GAAG;AACzC,UAAMY,IAAU,OAAO,iBAAiBV,GAAI,IAAI,GAC1CW,IACAX,EAAG,cACC,SAASU,EAAQ,iBAAiB,eAAe,CAAC,IAClD,SAASA,EAAQ,iBAAiB,cAAc,CAAC;AAE3D,IADsBb,EAAE,OAAe,uBAAuB,eAC1Cc,IAChBZ,EAAM,KAAK,SAASD,EAAK,GAAG,EAAE,gBAAgB,KAE9CC,EAAM,KAAK,SAASD,EAAK,GAAG,EAAE,gBAAgB;AAAA,EAElD;AAEA,IAAAC,EAAM,KAAK,SAASD,EAAK,GAAG,EAAE,gBAAgB;AAEtD,GAEac,IAAoB,CAACC,GAAiBP,IAAe,SAASQ,IAAe,WAC/EA,IAAAR,MAAS,WAAW,QAAQQ,GAC5BA,KAAQD,KAAc,MAGpBE,IAAe,CAACF,GAAiBC,IAAe,gBAClDA,KAAQD,KAAc;"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { Table as e } from "./table/index.mjs";
|
|
2
|
+
import { TablePage as p } from "./table-page/index.mjs";
|
|
3
|
+
import { Form as f } from "./form/index.mjs";
|
|
4
|
+
import { Tooltip as a } from "./tooltip/index.mjs";
|
|
5
|
+
export {
|
|
6
|
+
f as Form,
|
|
7
|
+
e as Table,
|
|
8
|
+
p as TablePage,
|
|
9
|
+
a as Tooltip
|
|
10
|
+
};
|
|
11
|
+
//# sourceMappingURL=index.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
const k = (n, t) => {
|
|
2
|
+
n == null || n.setCheckedNodes(t);
|
|
3
|
+
}, C = (n, t, e) => {
|
|
4
|
+
n.checked = e || t;
|
|
5
|
+
}, s = async (n, t) => {
|
|
6
|
+
for (let e = 0; e < t.length; e++)
|
|
7
|
+
t[e].checked === void 0 ? (t[e].checked = !0, await (n == null ? void 0 : n.setChecked(t[e].prop, !0))) : t[e].checked !== void 0 && await (n == null ? void 0 : n.setChecked(t[e].prop, t[e].checked)), t[e].children && t[e].children.length && s(n, t[e].children);
|
|
8
|
+
}, _ = (n, t, e) => n.level === t.level && n.parent === t.parent ? e === "prev" || e === "next" : !1, v = (n, t) => {
|
|
9
|
+
t == null || t.setChecked(s(t, [n.data]));
|
|
10
|
+
}, x = (n, t, e, r, H, l) => {
|
|
11
|
+
if (!l.height) {
|
|
12
|
+
e && e.parentElement && e.parentElement.parentElement && (e.parentElement.parentElement.style.height = "100%");
|
|
13
|
+
const h = e && parseInt(window.getComputedStyle(e.parentElement, null).paddingTop), c = e && parseInt(window.getComputedStyle(e.parentElement, null).paddingBottom), f = t && t.offsetHeight || 0, m = t && parseInt(window.getComputedStyle(t, null).marginTop) || 0, g = t && parseInt(window.getComputedStyle(t, null).marginBottom) || 0, i = n && n.headerFooter, u = i && i.offsetHeight || 0, a = r && r.offsetHeight || 0, w = r && parseInt(window.getComputedStyle(r, null).marginTop) || 0, d = e && e.parentElement && e.parentElement.offsetHeight - f - u - a - w - m - h - c, p = e && e.querySelector(".el-table__header-wrapper table").offsetHeight || 0, o = e && e.querySelector(".el-table__body-wrapper table").offsetHeight || 0, E = e && (e.querySelector(".el-table__body-wrapper.is-scrolling-left") || e.querySelector(".el-table__body-wrapper.is-scrolling-right") || e.querySelector(".el-table__body-wrapper.is-scrolling-middle")) ? 17 : 0;
|
|
14
|
+
e && (p + o + g > d || l.data && l.data.length === 0 ? (e.style.height = "0px", e.style.flex = "1", e.parentElement && e.parentElement.parentElement && (e.parentElement.parentElement.style.height = "100%")) : (e.style.height = o + p + 1 + E + "px", e.style.flex = "unset", e.parentElement && e.parentElement.parentElement && (e.parentElement.parentElement.style.height = "auto")));
|
|
15
|
+
}
|
|
16
|
+
}, q = {
|
|
17
|
+
children: "children",
|
|
18
|
+
label: "label",
|
|
19
|
+
class: (n) => n.show === !1 || n.setting || ["index", "selection"].includes(n.type) || ["selection"].includes(n.prop) ? "hide" : ""
|
|
20
|
+
};
|
|
21
|
+
export {
|
|
22
|
+
k as allShow,
|
|
23
|
+
_ as allowDrop,
|
|
24
|
+
C as checkTree,
|
|
25
|
+
v as nodeDragEnd,
|
|
26
|
+
x as resizeTaleHeight,
|
|
27
|
+
s as treeNode,
|
|
28
|
+
q as treeProps
|
|
29
|
+
};
|
|
30
|
+
//# sourceMappingURL=index.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.mjs","sources":["../../../../../packages/components/table/hooks/index.ts"],"sourcesContent":["\r\n\r\nimport type {RewriteTableColumnCtx, SelectTable, RewriteTableProps} from '../types/index'\r\nimport type Node from 'element-plus/es/components/tree/src/model/node'\r\nimport type {\r\n AllowDropType,\r\n} from 'element-plus/es/components/tree/src/tree.type'\r\n\r\nexport const allShow = (selectTable: any, tableColumns: RewriteTableColumnCtx[]) => {\r\n selectTable?.setCheckedNodes(tableColumns)\r\n}\r\n\r\nexport const checkTree = (data: Node, checked: boolean, childChecked: boolean) => {\r\n data.checked = childChecked || checked\r\n}\r\n\r\nexport const treeNode = async (selectTable: any, treeData2: any) => {\r\n // eslint-disable-next-line @typescript-eslint/prefer-for-of\r\n for (let i = 0; i < treeData2.length; i++) {\r\n if (treeData2[i].checked === undefined) {\r\n treeData2[i].checked = true\r\n await selectTable?.setChecked(treeData2[i].prop, true)\r\n } else if (treeData2[i].checked !== undefined) {\r\n await selectTable?.setChecked(treeData2[i].prop, treeData2[i].checked)\r\n }\r\n if (treeData2[i].children && treeData2[i].children.length) {\r\n treeNode(selectTable, treeData2[i].children)\r\n }\r\n }\r\n}\r\n\r\nexport const allowDrop = (draggingNode: Node, dropNode: Node, type: AllowDropType) => {\r\n if (draggingNode.level === dropNode.level) {\r\n if (draggingNode.parent === dropNode.parent) {\r\n return type === 'prev' || type === 'next'\r\n } else {\r\n return false\r\n }\r\n } else {\r\n // 不同级进行处理\r\n return false\r\n }\r\n}\r\n\r\nexport const nodeDragEnd = (node: Node, selectTable: SelectTable): void => {\r\n selectTable?.setChecked(treeNode(selectTable, [node.data]))\r\n}\r\n\r\nexport const resizeTaleHeight = (table: any, header: any, body: any, footer: any, headerFooterRef: any, tableProps: RewriteTableProps) => {\r\n if (!tableProps.height) {\r\n\r\n if (body && body.parentElement && body.parentElement.parentElement) {\r\n body.parentElement.parentElement.style.height = '100%'\r\n }\r\n\r\n const bodyPPT = (body && parseInt(window.getComputedStyle(body.parentElement, null).paddingTop))\r\n const bodyPPB = (body && parseInt(window.getComputedStyle(body.parentElement, null).paddingBottom))\r\n\r\n const headerH = (header && header.offsetHeight) || 0\r\n const headerMT = (header && parseInt(window.getComputedStyle(header, null).marginTop)) || 0\r\n const headerBT = (header && parseInt(window.getComputedStyle(header, null).marginBottom)) || 0\r\n\r\n const headerFooter = table && table.headerFooter\r\n const headerFooterH = (headerFooter && headerFooter.offsetHeight) || 0\r\n\r\n const footerH = (footer && footer.offsetHeight) || 0\r\n const footerMT = (footer && parseInt(window.getComputedStyle(footer, null).marginTop)) || 0\r\n const bodyCurrentH = body && body.parentElement && (body.parentElement.offsetHeight - headerH - headerFooterH - footerH - footerMT - headerMT - bodyPPT - bodyPPB)\r\n\r\n const tableHeaderH = (body && body.querySelector('.el-table__header-wrapper table').offsetHeight) || 0\r\n const tableBodyH = (body && body.querySelector('.el-table__body-wrapper table').offsetHeight) || 0\r\n\r\n\r\n const isXOverflow = (body && (body.querySelector('.el-table__body-wrapper.is-scrolling-left') || body.querySelector('.el-table__body-wrapper.is-scrolling-right') || body.querySelector('.el-table__body-wrapper.is-scrolling-middle')))\r\n const xOverflowH = isXOverflow ? 17 : 0\r\n\r\n // 当表格头和表格内容大于\r\n if (body) {\r\n if ((tableHeaderH + tableBodyH + headerBT) > bodyCurrentH || (tableProps.data && tableProps.data.length === 0)) {\r\n body.style.height = '0px'\r\n body.style.flex = '1'\r\n\r\n if (body.parentElement && body.parentElement.parentElement) {\r\n body.parentElement.parentElement.style.height = '100%'\r\n }\r\n } else {\r\n body.style.height = (tableBodyH + tableHeaderH + 1 + xOverflowH) + 'px'\r\n body.style.flex = 'unset'\r\n\r\n if (body.parentElement && body.parentElement.parentElement) {\r\n body.parentElement.parentElement.style.height = 'auto'\r\n }\r\n\r\n }\r\n }\r\n }\r\n}\r\n\r\nexport const treeProps = {\r\n children: 'children',\r\n label: 'label',\r\n class: (data: any) => {\r\n const hide = data.show === false || data.setting || ['index', 'selection'].includes(data.type) || ['selection'].includes(data.prop) ? 'hide' : ''\r\n return hide\r\n }\r\n}\r\n"],"names":["allShow","selectTable","tableColumns","checkTree","data","checked","childChecked","treeNode","treeData2","i","allowDrop","draggingNode","dropNode","type","nodeDragEnd","node","resizeTaleHeight","table","header","body","footer","headerFooterRef","tableProps","bodyPPT","bodyPPB","headerH","headerMT","headerBT","headerFooter","headerFooterH","footerH","footerMT","bodyCurrentH","tableHeaderH","tableBodyH","xOverflowH","treeProps"],"mappings":"AAQa,MAAAA,IAAU,CAACC,GAAkBC,MAA0C;AAChF,EAAAD,KAAA,QAAAA,EAAa,gBAAgBC;AACjC,GAEaC,IAAY,CAACC,GAAYC,GAAkBC,MAA0B;AAC9E,EAAAF,EAAK,UAAUE,KAAgBD;AACnC,GAEaE,IAAW,OAAON,GAAkBO,MAAmB;AAEhE,WAASC,IAAI,GAAGA,IAAID,EAAU,QAAQC;AAClC,IAAID,EAAUC,CAAC,EAAE,YAAY,UACfD,EAAAC,CAAC,EAAE,UAAU,IACvB,OAAMR,KAAA,gBAAAA,EAAa,WAAWO,EAAUC,CAAC,EAAE,MAAM,QAC1CD,EAAUC,CAAC,EAAE,YAAY,UAC1B,OAAAR,KAAA,gBAAAA,EAAa,WAAWO,EAAUC,CAAC,EAAE,MAAMD,EAAUC,CAAC,EAAE,WAE9DD,EAAUC,CAAC,EAAE,YAAYD,EAAUC,CAAC,EAAE,SAAS,UAC/CF,EAASN,GAAaO,EAAUC,CAAC,EAAE,QAAQ;AAGvD,GAEaC,IAAY,CAACC,GAAoBC,GAAgBC,MACtDF,EAAa,UAAUC,EAAS,SAC5BD,EAAa,WAAWC,EAAS,SAC1BC,MAAS,UAAUA,MAAS,SAMhC,IAIFC,IAAc,CAACC,GAAYd,MAAmC;AACvE,EAAAA,KAAA,QAAAA,EAAa,WAAWM,EAASN,GAAa,CAACc,EAAK,IAAI,CAAC;AAC7D,GAEaC,IAAmB,CAACC,GAAYC,GAAaC,GAAWC,GAAaC,GAAsBC,MAAkC;AAClI,MAAA,CAACA,EAAW,QAAQ;AAEpB,IAAIH,KAAQA,EAAK,iBAAiBA,EAAK,cAAc,kBAC5CA,EAAA,cAAc,cAAc,MAAM,SAAS;AAG9C,UAAAI,IAAWJ,KAAQ,SAAS,OAAO,iBAAiBA,EAAK,eAAe,IAAI,EAAE,UAAU,GACxFK,IAAWL,KAAQ,SAAS,OAAO,iBAAiBA,EAAK,eAAe,IAAI,EAAE,aAAa,GAE3FM,IAAWP,KAAUA,EAAO,gBAAiB,GAC7CQ,IAAYR,KAAU,SAAS,OAAO,iBAAiBA,GAAQ,IAAI,EAAE,SAAS,KAAM,GACpFS,IAAYT,KAAU,SAAS,OAAO,iBAAiBA,GAAQ,IAAI,EAAE,YAAY,KAAM,GAEvFU,IAAeX,KAASA,EAAM,cAC9BY,IAAiBD,KAAgBA,EAAa,gBAAiB,GAE/DE,IAAWV,KAAUA,EAAO,gBAAiB,GAC7CW,IAAYX,KAAU,SAAS,OAAO,iBAAiBA,GAAQ,IAAI,EAAE,SAAS,KAAM,GACpFY,IAAeb,KAAQA,EAAK,iBAAkBA,EAAK,cAAc,eAAeM,IAAUI,IAAgBC,IAAUC,IAAWL,IAAWH,IAAUC,GAEpJS,IAAgBd,KAAQA,EAAK,cAAc,iCAAiC,EAAE,gBAAiB,GAC/Fe,IAAcf,KAAQA,EAAK,cAAc,+BAA+B,EAAE,gBAAiB,GAI3FgB,IADehB,MAASA,EAAK,cAAc,2CAA2C,KAAKA,EAAK,cAAc,4CAA4C,KAAKA,EAAK,cAAc,6CAA6C,KACpM,KAAK;AAGtC,IAAIA,MACKc,IAAeC,IAAaP,IAAYK,KAAiBV,EAAW,QAAQA,EAAW,KAAK,WAAW,KACxGH,EAAK,MAAM,SAAS,OACpBA,EAAK,MAAM,OAAO,KAEdA,EAAK,iBAAiBA,EAAK,cAAc,kBACpCA,EAAA,cAAc,cAAc,MAAM,SAAS,YAGpDA,EAAK,MAAM,SAAUe,IAAaD,IAAe,IAAIE,IAAc,MACnEhB,EAAK,MAAM,OAAO,SAEdA,EAAK,iBAAiBA,EAAK,cAAc,kBACpCA,EAAA,cAAc,cAAc,MAAM,SAAS;AAAA,EAKhE;AACJ,GAEaiB,IAAY;AAAA,EACrB,UAAU;AAAA,EACV,OAAO;AAAA,EACP,OAAO,CAAChC,MACSA,EAAK,SAAS,MAASA,EAAK,WAAW,CAAC,SAAS,WAAW,EAAE,SAASA,EAAK,IAAI,KAAK,CAAC,WAAW,EAAE,SAASA,EAAK,IAAI,IAAI,SAAS;AAGvJ;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.mjs","sources":["../../../../packages/components/table/index.ts"],"sourcesContent":["import _Table from './src'\r\n\r\nimport type {App, Plugin} from 'vue'\r\ntype SFCWithInstall<T> = T & Plugin\r\nconst withInstall = <T>(comp: T) => {\r\n (comp as SFCWithInstall<T>).install = (app: App) => {\r\n const name = (comp as any).name\r\n // 注册组件\r\n app.component(name, comp as SFCWithInstall<T>)\r\n }\r\n return comp as SFCWithInstall<T>\r\n}\r\nexport const Table = withInstall(_Table)\r\nexport default Table\r\n"],"names":["withInstall","comp","app","name","Table","_Table"],"mappings":";AAIA,MAAMA,IAAc,CAAIC,OACnBA,EAA2B,UAAU,CAACC,MAAa;AAChD,QAAMC,IAAQF,EAAa;AAEvB,EAAAC,EAAA,UAAUC,GAAMF,CAAyB;AAAA,GAE1CA,IAEEG,IAAQJ,EAAYK,CAAM;"}
|
|
@@ -0,0 +1,177 @@
|
|
|
1
|
+
import { ref as n, defineComponent as x, onMounted as R, computed as C, watch as y, nextTick as p, createVNode as e, resolveComponent as r, createTextVNode as k, mergeProps as T } from "vue";
|
|
2
|
+
import { getUuid as E, getTreeNode as w, convertToFlat as A, columnProp as B } from "../../../utils/tools.mjs";
|
|
3
|
+
import { treeNode as F, treeProps as K, allowDrop as N, nodeDragEnd as _, resizeTaleHeight as P } from "../hooks/index.mjs";
|
|
4
|
+
import V from "./recuve-table-column.mjs";
|
|
5
|
+
import j from "../../../hooks/useWindowResize.mjs";
|
|
6
|
+
import { ArrowDown as H } from "../../../../node_modules/@element-plus/icons-vue/dist/index.mjs";
|
|
7
|
+
import "../../../assets/scss/dinert-table.scss.mjs";
|
|
8
|
+
const M = n(!1), O = n("table_" + E()), d = n(), b = n(!0), m = n(), z = n(null), D = n(null), S = n(null), $ = n(null), Q = /* @__PURE__ */ x({
|
|
9
|
+
name: "dinert-table",
|
|
10
|
+
props: {
|
|
11
|
+
table: {
|
|
12
|
+
type: Object
|
|
13
|
+
},
|
|
14
|
+
header: {
|
|
15
|
+
type: Boolean,
|
|
16
|
+
default: !0
|
|
17
|
+
},
|
|
18
|
+
footer: {
|
|
19
|
+
type: Boolean,
|
|
20
|
+
default: !0
|
|
21
|
+
},
|
|
22
|
+
tableSlot: {
|
|
23
|
+
type: Boolean,
|
|
24
|
+
default: !1
|
|
25
|
+
}
|
|
26
|
+
},
|
|
27
|
+
emits: ["SizeChange", "CurrentChange"],
|
|
28
|
+
setup(i) {
|
|
29
|
+
const s = () => {
|
|
30
|
+
P(m.value, z.value, D.value, S.value, $.value, i.table);
|
|
31
|
+
};
|
|
32
|
+
R(() => {
|
|
33
|
+
setTimeout(() => {
|
|
34
|
+
s();
|
|
35
|
+
});
|
|
36
|
+
});
|
|
37
|
+
const u = C(() => {
|
|
38
|
+
var o;
|
|
39
|
+
let t = ((o = i.table) == null ? void 0 : o.tableColumns) || [];
|
|
40
|
+
return t = t.map((a, l) => (a.sort = typeof a.sort > "u" ? l : a.sort, a)), t.sort((a, l) => a.sort - l.sort), t;
|
|
41
|
+
}), h = C(() => {
|
|
42
|
+
var t;
|
|
43
|
+
return w(u.value, "setting", [!0], "setting").length === 0 && ((t = i.table) == null ? void 0 : t.setting) !== !1;
|
|
44
|
+
}), c = w(u.value, "checked", [!0, void 0], "prop"), f = (t, o, a) => {
|
|
45
|
+
t.checked = a || o, p(() => {
|
|
46
|
+
s();
|
|
47
|
+
});
|
|
48
|
+
};
|
|
49
|
+
return j(() => {
|
|
50
|
+
s();
|
|
51
|
+
}, 100), y(() => {
|
|
52
|
+
var t;
|
|
53
|
+
return (t = i.table) == null ? void 0 : t.key;
|
|
54
|
+
}, () => {
|
|
55
|
+
p(async () => {
|
|
56
|
+
var t;
|
|
57
|
+
await F(d.value, (t = i.table) == null ? void 0 : t.tableColumns), setTimeout(() => {
|
|
58
|
+
s();
|
|
59
|
+
});
|
|
60
|
+
});
|
|
61
|
+
}, {
|
|
62
|
+
immediate: !0
|
|
63
|
+
}), y(() => u.value, () => {
|
|
64
|
+
p(() => {
|
|
65
|
+
const t = A(u.value), o = d.value && d.value.getCheckedKeys();
|
|
66
|
+
b.value = t.length === (o && o.length);
|
|
67
|
+
});
|
|
68
|
+
}, {
|
|
69
|
+
deep: !0
|
|
70
|
+
}), {
|
|
71
|
+
getSetting: h,
|
|
72
|
+
tableColumns: u,
|
|
73
|
+
checkTree: f,
|
|
74
|
+
defaultCheckedKeys: c,
|
|
75
|
+
resizeTaleHeightFn: s,
|
|
76
|
+
tableRef: m
|
|
77
|
+
};
|
|
78
|
+
},
|
|
79
|
+
render() {
|
|
80
|
+
var s, u, h, c, f, t, o, a;
|
|
81
|
+
const i = this.tableSlot ? this.$slots : {
|
|
82
|
+
default: (l) => {
|
|
83
|
+
var g, v;
|
|
84
|
+
return (v = (g = this.$slots)[l.prop && B(l.prop)]) == null ? void 0 : v.call(g, l);
|
|
85
|
+
}
|
|
86
|
+
};
|
|
87
|
+
return e("section", {
|
|
88
|
+
class: "dinert-table"
|
|
89
|
+
}, [this.header && e("header", {
|
|
90
|
+
class: "dinert-table-header",
|
|
91
|
+
ref: z
|
|
92
|
+
}, [this.$slots["header-left"] && e("div", {
|
|
93
|
+
class: "dinert-table-header-left"
|
|
94
|
+
}, [(u = (s = this.$slots)["header-left"]) == null ? void 0 : u.call(s)]), this.getSetting && e("div", {
|
|
95
|
+
class: "dinert-table-header-right"
|
|
96
|
+
}, [e(r("el-button-group"), null, {
|
|
97
|
+
default: () => [e(r("el-button"), {
|
|
98
|
+
type: b.value ? "primary" : "default"
|
|
99
|
+
}, {
|
|
100
|
+
default: () => [k("全部显示")]
|
|
101
|
+
}), e(r("el-popover"), {
|
|
102
|
+
teleported: !1
|
|
103
|
+
}, {
|
|
104
|
+
default: () => e("ul", {
|
|
105
|
+
class: "el-popover-classify"
|
|
106
|
+
}, [e(r("el-tree"), {
|
|
107
|
+
ref: d,
|
|
108
|
+
draggable: !0,
|
|
109
|
+
data: this.tableColumns,
|
|
110
|
+
"default-expand-all": !0,
|
|
111
|
+
"default-checked-keys": this.defaultCheckedKeys,
|
|
112
|
+
"show-checkbox": !0,
|
|
113
|
+
"node-key": "prop",
|
|
114
|
+
props: K,
|
|
115
|
+
"allow-drop": N,
|
|
116
|
+
onCheckChange: this.checkTree,
|
|
117
|
+
nodeDragEnd: (l) => _(l, d.value)
|
|
118
|
+
}, {
|
|
119
|
+
default: ({
|
|
120
|
+
data: l
|
|
121
|
+
}) => e("div", {
|
|
122
|
+
class: "text-dot tree-item"
|
|
123
|
+
}, [e(r("el-tooltip"), {
|
|
124
|
+
content: l.label,
|
|
125
|
+
placement: "top",
|
|
126
|
+
disabled: l.label && l.label.length < 8
|
|
127
|
+
}, {
|
|
128
|
+
default: () => e("span", null, [l.label])
|
|
129
|
+
})])
|
|
130
|
+
})]),
|
|
131
|
+
reference: () => e(r("el-button"), {
|
|
132
|
+
type: b.value ? "" : "primary"
|
|
133
|
+
}, {
|
|
134
|
+
default: () => [k("分类显示"), e(r("el-icon"), null, {
|
|
135
|
+
default: () => [e(H, null, null)]
|
|
136
|
+
})]
|
|
137
|
+
})
|
|
138
|
+
})]
|
|
139
|
+
})])]), this.$slots["header-footer"] && e("header", {
|
|
140
|
+
class: "dinert-table-headerFooter",
|
|
141
|
+
ref: $
|
|
142
|
+
}, [(c = (h = this.$slots)["header-footer"]) == null ? void 0 : c.call(h)]), e("div", {
|
|
143
|
+
ref: D,
|
|
144
|
+
class: "dinert-table-body"
|
|
145
|
+
}, [e(r("el-table"), T({
|
|
146
|
+
height: "100%",
|
|
147
|
+
border: !0
|
|
148
|
+
}, this.table, {
|
|
149
|
+
ref: m,
|
|
150
|
+
"row-key": (f = this.table) == null ? void 0 : f.rowKey
|
|
151
|
+
}, (t = this.table) == null ? void 0 : t.on), {
|
|
152
|
+
default: () => [e(V, {
|
|
153
|
+
table: this.table,
|
|
154
|
+
"table-columns": this.tableColumns,
|
|
155
|
+
"only-class": O.value,
|
|
156
|
+
"popover-value": M.value
|
|
157
|
+
}, i)]
|
|
158
|
+
})]), e("div", {
|
|
159
|
+
class: "dinert-table-footer",
|
|
160
|
+
ref: S
|
|
161
|
+
}, [e(r("el-pagination"), T({
|
|
162
|
+
"model:current-page": 1,
|
|
163
|
+
"model:page-size": 15,
|
|
164
|
+
pageSizes: [15, 30, 50, 70, 100],
|
|
165
|
+
"default-page-size": 15,
|
|
166
|
+
layout: "total, sizes, prev, pager, next, jumper",
|
|
167
|
+
total: 100
|
|
168
|
+
}, (o = this.table) == null ? void 0 : o.pagination, {
|
|
169
|
+
onSizeChange: (l) => this.$emit("SizeChange", l),
|
|
170
|
+
onCurrentChange: (l) => this.$emit("CurrentChange", l)
|
|
171
|
+
}, (a = this.table) == null ? void 0 : a.pagination.on), null)])]);
|
|
172
|
+
}
|
|
173
|
+
});
|
|
174
|
+
export {
|
|
175
|
+
Q as default
|
|
176
|
+
};
|
|
177
|
+
//# sourceMappingURL=index.mjs.map
|