@dinert/element-plus 1.1.25 → 1.1.27
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/components/form/src/index.mjs +111 -87
- package/es/packages/components/form/src/index.mjs.map +1 -1
- package/es/packages/components/form/src/slider.mjs +35 -0
- package/es/packages/components/form/src/slider.mjs.map +1 -0
- package/es/packages/components/form/src/time-picker.mjs +37 -0
- package/es/packages/components/form/src/time-picker.mjs.map +1 -0
- package/es/packages/components/form/src/time-select.mjs +37 -0
- package/es/packages/components/form/src/time-select.mjs.map +1 -0
- package/es/packages/components/form/utils/index.mjs +2 -1
- package/es/packages/components/form/utils/index.mjs.map +1 -1
- package/es/src/components/form/src/slider.d.ts +28 -0
- package/es/src/components/form/src/time-picker.d.ts +28 -0
- package/es/src/components/form/src/time-select.d.ts +28 -0
- package/es/src/components/form/types/components.d.ts +6 -2
- package/es/src/components/form/types/index.d.ts +17 -3
- package/es/style.css +1 -1
- package/lib/index.js +2 -2
- package/lib/index.js.map +1 -1
- package/lib/src/components/form/src/slider.d.ts +28 -0
- package/lib/src/components/form/src/time-picker.d.ts +28 -0
- package/lib/src/components/form/src/time-select.d.ts +28 -0
- package/lib/src/components/form/types/components.d.ts +6 -2
- package/lib/src/components/form/types/index.d.ts +17 -3
- package/lib/style.css +1 -1
- package/package.json +1 -1
package/dist/style.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
.tree-item{width:100%}.tree-item .el-tooltip__trigger{display:block;overflow:hidden;width:100%;text-align:left;text-overflow:ellipsis;white-space:nowrap}.el-popover-classify{overflow-y:auto;margin:0;padding:0;list-style:none}.el-popover-classify li{margin:0;padding:0;list-style:none}.el-popover-classify li:first-child{border-bottom:1px solid var(--el-fill-color);line-height:32px}.el-popover-classify>.el-tree>.el-tree-node>.el-tree-node__content>.el-tree-node__expand-icon.is-leaf{display:none}.el-popover-classify .el-tree-node__children{overflow:unset}.dinert-table{display:flex;padding:20px;height:100%;border-radius:var(--el-bg-radius);background-color:var(--el-bg-color);flex-direction:column;box-sizing:border-box}.dinert-table .dinert-table-header{display:flex;justify-content:space-between;margin-bottom:12px;text-align:right}.dinert-table .dinert-table-header .el-popover-classify li .el-checkbox{width:100%;line-height:24px;height:24px}.dinert-table .dinert-table-header .dinert-table-header-left{text-align:left}.dinert-table .dinert-table-body{flex:1;height:0}.dinert-table .dinert-table-body .el-table .el-popper{max-width:50%}.dinert-table .dinert-table-body .el-table .el-table__header .el-table__cell.setting .setting-icon{display:inline-block}.dinert-table .dinert-table-body .el-table .el-table__header .el-table__cell .cell{color:var(--zp-color-secondary-text-title)}.dinert-table .dinert-table-body .el-table .el-table__header .el-table__cell .cell .setting-icon{vertical-align:-1px;margin-left:4px;cursor:pointer}.dinert-table .dinert-table-body .el-table .el-table__body-wrapper td{color:var(--zp-color-secondary-text-title)}.dinert-table .dinert-table-body .el-table .el-table__body-wrapper td .cell.el-tooltip>.cell-item{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.dinert-table .dinert-table-body .el-table .el-table__body-wrapper td .cell.el-tooltip>.cell-item .cell-item-text{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.dinert-table .dinert-table-body .el-table .el-table__body-wrapper .operations .el-dropdown{vertical-align:-2px}.dinert-table .dinert-table-body .el-table .el-table__body-wrapper .operations .cell{display:flex;justify-content:center;align-items:center}.dinert-table .dinert-table-body .el-table .el-table__body-wrapper .operations .cell .el-button{margin-right:8px;margin-left:0}.dinert-table .dinert-table-body .el-table .el-table__body-wrapper .operations .cell .el-button:focus-visible{outline:none}.dinert-table .dinert-table-body .el-table .el-table__body-wrapper .operations .cell .el-svg-icon{font-size:14px;color:var(--el-color-primary);cursor:pointer;flex:1}.dinert-table .dinert-table-body .el-table .el-table__body-wrapper .operations .cell .el-svg-icon.delete{color:var(--el-color-danger)}.dinert-table .dinert-table-body .el-table .el-table__body-wrapper .operations .cell .svg-icon{width:16px;height:16px;vertical-align:-2px;flex:1;color:var(--el-color-primary);cursor:pointer;fill:var(--el-color-primary)}.dinert-table .dinert-table-body .el-table .el-table__body-wrapper .operations .cell .svg-icon.f-14{width:14px;height:14px}.dinert-table .dinert-table-footer{display:flex;margin-top:16px}.dinert-table .dinert-table-footer .el-pagination{display:flex;flex-wrap:wrap}.dinert-form.el-form{display:flex;overflow:hidden;padding:0;min-height:50px;border-radius:4px;background-color:var(--el-bg-color);transition:all .3s cubic-bezier(.645,.045,.355,1);box-sizing:content-box}.dinert-form.el-form.near.packUp{max-height:50px}.dinert-form.el-form.near .el-form-left .el-col{display:flex;align-items:center;margin-right:10px;width:auto;max-width:unset;flex:unset}.dinert-form.el-form.near .el-form-right.isArrow{width:230px;flex:0 0 230px}.dinert-form.el-form.dialog .el-form-left{flex:1}.dinert-form.el-form.dialog .el-form-left .el-col .label-text>div{width:100%}.dinert-form.el-form .el-form-left .el-col .label-text .el-radio.is-bordered,.dinert-form.el-form .el-form-left .el-col .label-text .el-checkbox.is-bordered{margin-right:16px}.dinert-form.el-form .el-form-left .el-col .label-text .el-date-editor{width:210px}.dinert-form.el-form .el-form-left .el-col .label-text .el-date-editor--daterange{width:260px}.dinert-form.el-form .el-form-left .el-col .label-text>.el-input{width:210px}.dinert-form.el-form .el-form-left .el-col .label-text>.el-select{width:210px}.dinert-form.el-form .el-form-left .el-col .label-text .el-date-editor--datetimerange{width:400px}.dinert-form.el-form .el-form-right{display:flex;margin-left:24px}.dinert-form.el-form .el-form-right .el-form-right-operation{padding:0}.dinert-form.el-form .el-form-right .el-form-right-operation.el-button.is-text{padding-right:0;background-color:unset}.dinert-form.el-form div.el-form-item{position:relative;display:flex;margin-right:0;margin-bottom:18px;width:100%}.dinert-form.el-form div.el-form-item.show-label .label-text{overflow:unset;text-overflow:unset;white-space:unset}.dinert-form.el-form div.el-form-item.label-wrap .el-form-item__label{height:auto}.dinert-form.el-form div.el-form-item.label-wrap .el-form-item__label .label-text{display:inline;text-align:left;white-space:normal}.dinert-form.el-form .el-form-item__content{flex:1;margin-left:0}.dinert-form.el-form .el-form-item__content .el-tooltip__trigger
|
|
1
|
+
.tree-item{width:100%}.tree-item .el-tooltip__trigger{display:block;overflow:hidden;width:100%;text-align:left;text-overflow:ellipsis;white-space:nowrap}.el-popover-classify{overflow-y:auto;margin:0;padding:0;list-style:none}.el-popover-classify li{margin:0;padding:0;list-style:none}.el-popover-classify li:first-child{border-bottom:1px solid var(--el-fill-color);line-height:32px}.el-popover-classify>.el-tree>.el-tree-node>.el-tree-node__content>.el-tree-node__expand-icon.is-leaf{display:none}.el-popover-classify .el-tree-node__children{overflow:unset}.dinert-table{display:flex;padding:20px;height:100%;border-radius:var(--el-bg-radius);background-color:var(--el-bg-color);flex-direction:column;box-sizing:border-box}.dinert-table .dinert-table-header{display:flex;justify-content:space-between;margin-bottom:12px;text-align:right}.dinert-table .dinert-table-header .el-popover-classify li .el-checkbox{width:100%;line-height:24px;height:24px}.dinert-table .dinert-table-header .dinert-table-header-left{text-align:left}.dinert-table .dinert-table-body{flex:1;height:0}.dinert-table .dinert-table-body .el-table .el-popper{max-width:50%}.dinert-table .dinert-table-body .el-table .el-table__header .el-table__cell.setting .setting-icon{display:inline-block}.dinert-table .dinert-table-body .el-table .el-table__header .el-table__cell .cell{color:var(--zp-color-secondary-text-title)}.dinert-table .dinert-table-body .el-table .el-table__header .el-table__cell .cell .setting-icon{vertical-align:-1px;margin-left:4px;cursor:pointer}.dinert-table .dinert-table-body .el-table .el-table__body-wrapper td{color:var(--zp-color-secondary-text-title)}.dinert-table .dinert-table-body .el-table .el-table__body-wrapper td .cell.el-tooltip>.cell-item{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.dinert-table .dinert-table-body .el-table .el-table__body-wrapper td .cell.el-tooltip>.cell-item .cell-item-text{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.dinert-table .dinert-table-body .el-table .el-table__body-wrapper .operations .el-dropdown{vertical-align:-2px}.dinert-table .dinert-table-body .el-table .el-table__body-wrapper .operations .cell{display:flex;justify-content:center;align-items:center}.dinert-table .dinert-table-body .el-table .el-table__body-wrapper .operations .cell .el-button{margin-right:8px;margin-left:0}.dinert-table .dinert-table-body .el-table .el-table__body-wrapper .operations .cell .el-button:focus-visible{outline:none}.dinert-table .dinert-table-body .el-table .el-table__body-wrapper .operations .cell .el-svg-icon{font-size:14px;color:var(--el-color-primary);cursor:pointer;flex:1}.dinert-table .dinert-table-body .el-table .el-table__body-wrapper .operations .cell .el-svg-icon.delete{color:var(--el-color-danger)}.dinert-table .dinert-table-body .el-table .el-table__body-wrapper .operations .cell .svg-icon{width:16px;height:16px;vertical-align:-2px;flex:1;color:var(--el-color-primary);cursor:pointer;fill:var(--el-color-primary)}.dinert-table .dinert-table-body .el-table .el-table__body-wrapper .operations .cell .svg-icon.f-14{width:14px;height:14px}.dinert-table .dinert-table-footer{display:flex;margin-top:16px}.dinert-table .dinert-table-footer .el-pagination{display:flex;flex-wrap:wrap}.dinert-form.el-form{display:flex;overflow:hidden;padding:0;min-height:50px;border-radius:4px;background-color:var(--el-bg-color);transition:all .3s cubic-bezier(.645,.045,.355,1);box-sizing:content-box}.dinert-form.el-form.near.packUp{max-height:50px}.dinert-form.el-form.near .el-form-left .el-col{display:flex;align-items:center;margin-right:10px;width:auto;max-width:unset;flex:unset}.dinert-form.el-form.near .el-form-right.isArrow{width:230px;flex:0 0 230px}.dinert-form.el-form.dialog .el-form-left{flex:1}.dinert-form.el-form.dialog .el-form-left .el-col .label-text>div{width:100%}.dinert-form.el-form.dialog .el-form-left .el-col.slider .label-text{overflow:unset}.dinert-form.el-form.dialog .el-form-left .el-col.slider .label-text .el-slider{padding-left:12px}.dinert-form.el-form.dialog .el-form-left .el-col.slider .label-text .el-slider .el-input-number{width:auto}.dinert-form.el-form .el-form-left .el-col .label-text .el-radio.is-bordered,.dinert-form.el-form .el-form-left .el-col .label-text .el-checkbox.is-bordered{margin-right:16px}.dinert-form.el-form .el-form-left .el-col .label-text .el-date-editor{width:210px}.dinert-form.el-form .el-form-left .el-col .label-text .el-date-editor--daterange{width:260px}.dinert-form.el-form .el-form-left .el-col .label-text>.el-input{width:210px}.dinert-form.el-form .el-form-left .el-col .label-text>.el-select{width:210px}.dinert-form.el-form .el-form-left .el-col .label-text .el-date-editor--datetimerange{width:400px}.dinert-form.el-form .el-form-right{display:flex;margin-left:24px}.dinert-form.el-form .el-form-right .el-form-right-operation{padding:0}.dinert-form.el-form .el-form-right .el-form-right-operation.el-button.is-text{padding-right:0;background-color:unset}.dinert-form.el-form div.el-form-item{position:relative;display:flex;margin-right:0;margin-bottom:18px;width:100%}.dinert-form.el-form div.el-form-item.show-label .label-text{overflow:unset;text-overflow:unset;white-space:unset}.dinert-form.el-form div.el-form-item.label-wrap .el-form-item__label{height:auto}.dinert-form.el-form div.el-form-item.label-wrap .el-form-item__label .label-text{display:inline;text-align:left;white-space:normal}.dinert-form.el-form .el-form-item__content{flex:1;margin-left:0}.dinert-form.el-form .el-form-item__content .el-tooltip__trigger:not(.el-slider__button){width:100%}.dinert-form.el-form .el-form-item__content .el-input-number{width:100%}.dinert-form.el-form .el-form-item__content .el-input-number .el-input__inner{text-align:center}.dinert-form.el-form .el-form-item__content .el-textarea .el-textarea__inner{height:80px}.dinert-form.el-form .el-form-item__content .el-date-editor,.dinert-form.el-form .el-form-item__content .el-date-editor .el-input__wrapper{width:100%;box-sizing:border-box}.dinert-form.el-form .el-form-item__content .el-input__inner{overflow:hidden;text-align:left;text-overflow:ellipsis;white-space:nowrap}.dinert-form.el-form .el-form-item__content .el-form-item__label{overflow:hidden;width:80px;max-width:80px;text-align:right;text-overflow:ellipsis;white-space:nowrap}.dinert-form.el-form .el-form-item__content .el-form-item__label .el-tooltip,.dinert-form.el-form .el-form-item__content .el-form-item__label .el-tooltip .label-text{display:inline}.dinert-table-page{display:flex;flex-direction:column;box-sizing:border-box}.dinert-table-page.text-wrap .el-table__header .cell{white-space:pre-wrap}.dinert-table-page.text-wrap .el-table__body .el-table__row td>.cell,.dinert-table-page.text-wrap .el-table__body .el-table__row td>.cell>.cell-item,.dinert-table-page.text-wrap .el-table__body .el-table__row td .cell.el-tooltip>.cell-item{white-space:pre-wrap}.dinert-table-page.text-wrap .el-table__body .el-table__row .el-button>span{text-align:left}.dinert-table-page.text-wrap .el-table__body .el-table__row span{white-space:pre-wrap;line-height:23px}.dinert-table-page.header-center .el-table__header .el-table__cell{text-align:center}.dinert-table-page.near .el-form-left{flex:unset}.dinert-table-page.near .el-form-left .el-col{margin-right:16px;width:auto;max-width:unset;flex:unset}.dinert-table-page.near .dinert-table-footer .el-pagination{margin-left:auto}.dinert-table-page.maxWidthAuto .el-form .el-form-item .el-form-item__label{max-width:unset}.dinert-table-page .el-form.dinert-form{padding:20px 20px 0;max-height:300px}.dinert-table-page .dinert-table{padding-top:0;height:0;flex:1}.dinert-tooltip.el-tooltip__trigger{display:block;height:100%}.dinert-tooltip.el-tooltip__trigger .text-tooltip{position:absolute;left:-999999999999px}.dinert-tooltip.el-tooltip__trigger .label-text{display:block;overflow:hidden;width:100%;height:100%;text-overflow:ellipsis;white-space:nowrap}.el-overlay.autoHeight .el-dialog{height:80%}.el-overlay.notPadding .el-dialog__body{padding:0}.el-overlay .el-dialog{top:10%;display:flex;min-width:310px;max-height:80%;border-radius:4px;flex-direction:column;--el-dialog-margin-top: 0;--el-dialog-padding-primary: 0}.el-overlay .el-dialog.is-fullscreen{top:unset;max-height:unset}.el-overlay .el-dialog__headerbtn{right:0;width:40px;height:100%;color:var(--el-color-info)}.el-overlay .el-dialog .full{position:absolute;top:-1.5px;right:34px;display:flex;justify-content:center;align-items:center;width:40px;height:100%;font-size:var(--el-message-close-size, 16px);border:none;color:var(--el-color-info);background:transparent;outline:none;cursor:pointer}.el-overlay .el-dialog .full:hover .icon{fill:var(--el-color-primary);color:var(--el-color-primary)}.el-overlay .el-dialog .full .icon{overflow:hidden;width:14px;height:14px;vertical-align:-.15em;fill:var(--el-color-info)}.el-overlay .el-dialog__header{position:relative;margin-right:0;padding:16px 24px;height:54px;box-sizing:border-box}.el-overlay .el-dialog__body{display:flex;overflow-y:auto;padding:24px;flex-direction:column;flex:1;word-wrap:break-word}.el-overlay .el-dialog__body>.el-form{overflow:unset}.el-overlay .el-dialog__footer{display:flex;justify-content:center;align-items:center;clear:both;padding:12px 24px 16px}.el-overlay .el-dialog__footer .el-button{margin:0}.el-overlay .el-dialog__footer .el-button+.el-button{margin-left:12px}
|
|
@@ -1,25 +1,28 @@
|
|
|
1
|
-
import { defineComponent as R, toRefs as C, ref as b, onBeforeUpdate as F, computed as I, createVNode as r, resolveComponent as n, mergeProps as
|
|
2
|
-
import
|
|
1
|
+
import { defineComponent as R, toRefs as C, ref as b, onBeforeUpdate as F, computed as I, createVNode as r, resolveComponent as n, mergeProps as m, withModifiers as T, Fragment as L, isVNode as x, nextTick as S } from "vue";
|
|
2
|
+
import _ from "./input.mjs";
|
|
3
3
|
import U from "./input-number.mjs";
|
|
4
|
-
import
|
|
4
|
+
import $ from "./input-autocomplete.mjs";
|
|
5
5
|
import A from "./select.mjs";
|
|
6
6
|
import B from "./select-v2.mjs";
|
|
7
7
|
import q from "./switch.mjs";
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
import
|
|
11
|
-
import
|
|
12
|
-
import
|
|
13
|
-
import
|
|
14
|
-
import
|
|
15
|
-
import
|
|
16
|
-
import
|
|
17
|
-
import
|
|
8
|
+
import M from "./date.mjs";
|
|
9
|
+
import V from "./radio.mjs";
|
|
10
|
+
import j from "./tree-select.mjs";
|
|
11
|
+
import D from "./rate.mjs";
|
|
12
|
+
import E from "./checkbox.mjs";
|
|
13
|
+
import O from "./cascader.mjs";
|
|
14
|
+
import N from "./slider.mjs";
|
|
15
|
+
import P from "./time-picker.mjs";
|
|
16
|
+
import z from "./time-select.mjs";
|
|
17
|
+
import H from "../../../hooks/useWindowResize.mjs";
|
|
18
|
+
import { customPlaceholder as v, labelMouseEnter as W, getTooltipValue as G, valueMouseEnter as J, getSpanValue as K, formItemSlot as g, renderSlot as p } from "../utils/index.mjs";
|
|
19
|
+
import { getUuid as Q, dataTransformRod as X } from "../../../utils/tools.mjs";
|
|
20
|
+
import { ArrowUp as Y, ArrowDown as Z } from "../../../../node_modules/@element-plus/icons-vue/dist/index.mjs";
|
|
18
21
|
import "../../../assets/scss/dinert-form.scss.mjs";
|
|
19
|
-
function
|
|
20
|
-
return typeof
|
|
22
|
+
function ee(u) {
|
|
23
|
+
return typeof u == "function" || Object.prototype.toString.call(u) === "[object Object]" && !x(u);
|
|
21
24
|
}
|
|
22
|
-
const
|
|
25
|
+
const Ce = /* @__PURE__ */ R({
|
|
23
26
|
name: "dinert-form",
|
|
24
27
|
props: {
|
|
25
28
|
form: {
|
|
@@ -32,39 +35,39 @@ const ye = /* @__PURE__ */ R({
|
|
|
32
35
|
}
|
|
33
36
|
},
|
|
34
37
|
emits: ["UnFold", "SearchFn", "ResetFn"],
|
|
35
|
-
setup(
|
|
38
|
+
setup(u, {
|
|
36
39
|
emit: e
|
|
37
40
|
}) {
|
|
38
41
|
const {
|
|
39
|
-
form:
|
|
40
|
-
} = C(
|
|
41
|
-
|
|
42
|
-
},
|
|
42
|
+
form: f
|
|
43
|
+
} = C(u), l = b(f.value.packUp === void 0), i = b(!1), h = b(), c = b({}), o = (a, d) => {
|
|
44
|
+
c.value[a] = d;
|
|
45
|
+
}, s = b("form_" + Q());
|
|
43
46
|
F(() => {
|
|
44
|
-
|
|
47
|
+
c.value = {};
|
|
45
48
|
});
|
|
46
49
|
const k = I(() => {
|
|
47
|
-
const
|
|
48
|
-
return Object.keys(
|
|
49
|
-
const y =
|
|
50
|
-
|
|
50
|
+
const a = [];
|
|
51
|
+
return Object.keys(f.value.formItem).forEach((d) => {
|
|
52
|
+
const y = f.value.formItem[d];
|
|
53
|
+
a.push({
|
|
51
54
|
...y,
|
|
52
55
|
key: d
|
|
53
56
|
});
|
|
54
|
-
}),
|
|
57
|
+
}), a.sort((d, y) => (d.sort || 1 / 0) - (y.sort || 1 / 0)), a;
|
|
55
58
|
}), w = () => {
|
|
56
|
-
let
|
|
57
|
-
|
|
58
|
-
const d =
|
|
59
|
-
d !== y ? i.value = !0 : (l.value || (l.value = !0), i.value = !1),
|
|
59
|
+
let a = document.querySelectorAll(`.${s.value} .el-form-left > div`);
|
|
60
|
+
a[0] && (i.value = !1, S(() => {
|
|
61
|
+
const d = a[0].getBoundingClientRect().top, y = a[a.length - 1].getBoundingClientRect().top;
|
|
62
|
+
d !== y ? i.value = !0 : (l.value || (l.value = !0), i.value = !1), a = null;
|
|
60
63
|
}));
|
|
61
64
|
};
|
|
62
|
-
return
|
|
65
|
+
return H(() => {
|
|
63
66
|
w();
|
|
64
67
|
}, 100, !0), {
|
|
65
68
|
formItemMap: k,
|
|
66
|
-
formClass:
|
|
67
|
-
formTypeRef:
|
|
69
|
+
formClass: s,
|
|
70
|
+
formTypeRef: c,
|
|
68
71
|
formRef: h,
|
|
69
72
|
packUp: l,
|
|
70
73
|
isArrow: i,
|
|
@@ -75,27 +78,29 @@ const ye = /* @__PURE__ */ R({
|
|
|
75
78
|
};
|
|
76
79
|
},
|
|
77
80
|
render() {
|
|
78
|
-
let
|
|
79
|
-
return r(n("el-form"),
|
|
81
|
+
let u;
|
|
82
|
+
return r(n("el-form"), m({
|
|
80
83
|
inline: !0
|
|
81
84
|
}, this.form, {
|
|
82
85
|
ref: (e) => {
|
|
83
86
|
this.formRef = e;
|
|
84
87
|
},
|
|
85
88
|
class: [this.formClass, this.packUp ? "" : "packUp", "dinert-form"],
|
|
89
|
+
onSubmit: T(() => {
|
|
90
|
+
}, ["stop", "prevent"]),
|
|
86
91
|
key: this.form.key
|
|
87
92
|
}), {
|
|
88
|
-
default: () => [r(n("el-row"),
|
|
93
|
+
default: () => [r(n("el-row"), m(this.form.row, {
|
|
89
94
|
class: "el-form-left"
|
|
90
|
-
}),
|
|
91
|
-
const
|
|
95
|
+
}), ee(u = this.formItemMap.map((e) => {
|
|
96
|
+
const f = {};
|
|
92
97
|
let l = typeof e.vif == "function" ? e.vif(this.form.model) : e.vif;
|
|
93
98
|
l = l === void 0 && typeof this.form.vif == "function" ? this.form.vif(this.form.model) : l, l = l === void 0 ? !0 : l;
|
|
94
99
|
let i = typeof e.show == "function" ? e.show(this.form.model) : e.show;
|
|
95
100
|
if (i = i === void 0 ? !0 : i, e.options = {
|
|
96
101
|
placeholder: v(typeof e.label == "function" ? e.label(this.form.model) : e.label, e.type),
|
|
97
102
|
...e.options
|
|
98
|
-
}, i || (
|
|
103
|
+
}, i || (f.display = "none"), l) {
|
|
99
104
|
e.required = e.required === void 0 ? e.required || this.form.required : e.required, e.showLabel = e.showLabel === void 0 ? e.showLabel || this.form.showLabel : e.showLabel;
|
|
100
105
|
let h = e.rules || [];
|
|
101
106
|
h = e.required ? [{
|
|
@@ -103,9 +108,9 @@ const ye = /* @__PURE__ */ R({
|
|
|
103
108
|
trigger: ["blur", "change"],
|
|
104
109
|
message: v(typeof e.label == "function" ? e.label(this.form.model) : e.label, e.type)
|
|
105
110
|
}].concat(h) : h, h = e.showLabel ? [] : h;
|
|
106
|
-
const
|
|
107
|
-
return r(n("el-col"),
|
|
108
|
-
style:
|
|
111
|
+
const c = e.showLabel ? !0 : e.tempValueDisabled;
|
|
112
|
+
return r(n("el-col"), m({
|
|
113
|
+
style: f,
|
|
109
114
|
class: [e.type, e.key],
|
|
110
115
|
key: e.key
|
|
111
116
|
}, {
|
|
@@ -117,7 +122,7 @@ const ye = /* @__PURE__ */ R({
|
|
|
117
122
|
...this.form.colLayout,
|
|
118
123
|
...e.colLayout
|
|
119
124
|
}), {
|
|
120
|
-
default: () => [r(n("el-form-item"),
|
|
125
|
+
default: () => [r(n("el-form-item"), m({
|
|
121
126
|
key: e.key,
|
|
122
127
|
prop: e.key,
|
|
123
128
|
class: [e.labelWrap ? "label-wrap" : "", e.showLabel || this.form.showLabel ? "show-label" : ""]
|
|
@@ -130,90 +135,102 @@ const ye = /* @__PURE__ */ R({
|
|
|
130
135
|
key: e.key,
|
|
131
136
|
content: typeof e.label == "function" ? e.label(this.form.model) : e.label,
|
|
132
137
|
disabled: e.labelDisabled,
|
|
133
|
-
onLabelMouseEnter: (o) =>
|
|
138
|
+
onLabelMouseEnter: (o) => W(o, e, this)
|
|
134
139
|
}, null),
|
|
135
140
|
default: () => r(n("dinert-tooltip"), {
|
|
136
141
|
key: e.key,
|
|
137
|
-
content: String(
|
|
138
|
-
disabled:
|
|
142
|
+
content: String(G(this.form.model[e.key], e)),
|
|
143
|
+
disabled: c,
|
|
139
144
|
item: e,
|
|
140
|
-
onLabelMouseEnter: (o) =>
|
|
145
|
+
onLabelMouseEnter: (o) => J(o, e, this.form.model[e.key], this)
|
|
141
146
|
}, {
|
|
142
147
|
// eslint-disable-next-line max-statements
|
|
143
148
|
default: () => {
|
|
144
149
|
var k, w;
|
|
145
150
|
const o = {};
|
|
146
|
-
let
|
|
151
|
+
let s = r("span", null, [X(K(this.form.model[e.key], e))]);
|
|
147
152
|
if (this.$slots[g(e.key)])
|
|
148
|
-
|
|
153
|
+
s = (w = (k = this.$slots)[g(e.key)]) == null ? void 0 : w.call(k, {
|
|
149
154
|
...e,
|
|
150
155
|
model: this.form.model
|
|
151
156
|
});
|
|
152
157
|
else {
|
|
153
158
|
if (e.showLabel || this.form.showLabel && [!0, void 0].includes(e.showLabel))
|
|
154
|
-
return
|
|
155
|
-
["input", "textarea"].includes(e.type) ? (p(["prefix", "suffix", "prepend", "append"], this, o, e),
|
|
159
|
+
return s;
|
|
160
|
+
["input", "textarea"].includes(e.type) ? (p(["prefix", "suffix", "prepend", "append"], this, o, e), s = r(_, {
|
|
156
161
|
form: this.form,
|
|
157
162
|
formItem: e,
|
|
158
|
-
ref: (
|
|
159
|
-
}, o)) : ["input-number"].includes(e.type) ? (p(["decrease-icon", "increase-icon"], this, o, e),
|
|
163
|
+
ref: (t) => this.setFormTypeRefs(e.key, t)
|
|
164
|
+
}, o)) : ["input-number"].includes(e.type) ? (p(["decrease-icon", "increase-icon"], this, o, e), s = r(U, {
|
|
160
165
|
form: this.form,
|
|
161
166
|
formItem: e,
|
|
162
|
-
ref: (
|
|
163
|
-
}, o)) : ["input-autocomplete"].includes(e.type) ? (p(["prefix", "suffix", "prepend", "append", "loading"], this, o, e),
|
|
167
|
+
ref: (t) => this.setFormTypeRefs(e.key, t)
|
|
168
|
+
}, o)) : ["input-autocomplete"].includes(e.type) ? (p(["prefix", "suffix", "prepend", "append", "loading"], this, o, e), s = r($, {
|
|
164
169
|
form: this.form,
|
|
165
170
|
formItem: e,
|
|
166
|
-
ref: (
|
|
167
|
-
}, o)) : ["select"].includes(e.type) ? (p(["header", "footer", "prefix", "empty", "tag", "loading", "label"], this, o, e),
|
|
171
|
+
ref: (t) => this.setFormTypeRefs(e.key, t)
|
|
172
|
+
}, o)) : ["select"].includes(e.type) ? (p(["header", "footer", "prefix", "empty", "tag", "loading", "label"], this, o, e), s = r(A, {
|
|
168
173
|
form: this.form,
|
|
169
174
|
formItem: e,
|
|
170
|
-
ref: (
|
|
171
|
-
}, o)) : ["select-v2"].includes(e.type) ? (p(["header", "footer", "prefix", "empty", "tag", "loading", "label"], this, o, e),
|
|
175
|
+
ref: (t) => this.setFormTypeRefs(e.key, t)
|
|
176
|
+
}, o)) : ["select-v2"].includes(e.type) ? (p(["header", "footer", "prefix", "empty", "tag", "loading", "label"], this, o, e), s = r(B, {
|
|
172
177
|
form: this.form,
|
|
173
178
|
formItem: e,
|
|
174
|
-
ref: (
|
|
175
|
-
}, o)) : ["switch"].includes(e.type) ? (p(["active-action", "inactive-action"], this, o, e),
|
|
179
|
+
ref: (t) => this.setFormTypeRefs(e.key, t)
|
|
180
|
+
}, o)) : ["switch"].includes(e.type) ? (p(["active-action", "inactive-action"], this, o, e), s = r(q, {
|
|
176
181
|
form: this.form,
|
|
177
182
|
formItem: e,
|
|
178
|
-
ref: (
|
|
179
|
-
}, o)) : ["datetime", "date", "dates", "week", "month", "year", "years", "datetimerange", "daterange", "monthrange", "yearrange"].includes(e.type) ? (p(["range-separator", "prev-month", "next-month", "prev-year", "next-year"], this, o, e),
|
|
183
|
+
ref: (t) => this.setFormTypeRefs(e.key, t)
|
|
184
|
+
}, o)) : ["datetime", "date", "dates", "week", "month", "year", "years", "datetimerange", "daterange", "monthrange", "yearrange"].includes(e.type) ? (p(["range-separator", "prev-month", "next-month", "prev-year", "next-year"], this, o, e), s = r(M, {
|
|
180
185
|
form: this.form,
|
|
181
186
|
formItem: e,
|
|
182
|
-
ref: (
|
|
183
|
-
}, o)) : ["radio", "radio-button"].includes(e.type) ?
|
|
187
|
+
ref: (t) => this.setFormTypeRefs(e.key, t)
|
|
188
|
+
}, o)) : ["radio", "radio-button"].includes(e.type) ? s = r(V, {
|
|
184
189
|
form: this.form,
|
|
185
190
|
formItem: e,
|
|
186
|
-
ref: (
|
|
187
|
-
}, o) : ["tree-select"].includes(e.type) ? (p(["header", "footer", "prefix", "empty", "tag", "loading", "label"], this, o, e),
|
|
191
|
+
ref: (t) => this.setFormTypeRefs(e.key, t)
|
|
192
|
+
}, o) : ["tree-select"].includes(e.type) ? (p(["header", "footer", "prefix", "empty", "tag", "loading", "label"], this, o, e), s = r(j, {
|
|
188
193
|
form: this.form,
|
|
189
194
|
formItem: e,
|
|
190
|
-
ref: (
|
|
191
|
-
}, o)) : ["rate"].includes(e.type) ?
|
|
195
|
+
ref: (t) => this.setFormTypeRefs(e.key, t)
|
|
196
|
+
}, o)) : ["rate"].includes(e.type) ? s = r(D, {
|
|
192
197
|
form: this.form,
|
|
193
198
|
formItem: e,
|
|
194
|
-
ref: (
|
|
195
|
-
}, o) : ["checkbox", "checkbox-button"].includes(e.type) ?
|
|
199
|
+
ref: (t) => this.setFormTypeRefs(e.key, t)
|
|
200
|
+
}, o) : ["checkbox", "checkbox-button"].includes(e.type) ? s = r(E, {
|
|
196
201
|
form: this.form,
|
|
197
202
|
formItem: e,
|
|
198
|
-
ref: (
|
|
199
|
-
}, o) : ["cascader"].includes(e.type)
|
|
200
|
-
ref: (
|
|
203
|
+
ref: (t) => this.setFormTypeRefs(e.key, t)
|
|
204
|
+
}, o) : ["cascader"].includes(e.type) ? (p(["empty"], this, o, e), s = r(O, {
|
|
205
|
+
ref: (t) => this.setFormTypeRefs(e.key, t),
|
|
206
|
+
form: this.form,
|
|
207
|
+
formItem: e
|
|
208
|
+
}, o)) : ["slider"].includes(e.type) ? s = r(N, {
|
|
209
|
+
ref: (t) => this.setFormTypeRefs(e.key, t),
|
|
210
|
+
form: this.form,
|
|
211
|
+
formItem: e
|
|
212
|
+
}, o) : ["time-picker"].includes(e.type) ? s = r(P, {
|
|
213
|
+
ref: (t) => this.setFormTypeRefs(e.key, t),
|
|
214
|
+
form: this.form,
|
|
215
|
+
formItem: e
|
|
216
|
+
}, o) : ["time-select"].includes(e.type) && (s = r(z, {
|
|
217
|
+
ref: (t) => this.setFormTypeRefs(e.key, t),
|
|
201
218
|
form: this.form,
|
|
202
219
|
formItem: e
|
|
203
220
|
}, o));
|
|
204
221
|
}
|
|
205
|
-
return
|
|
222
|
+
return s;
|
|
206
223
|
},
|
|
207
224
|
defaultAfter: () => {
|
|
208
|
-
var o,
|
|
209
|
-
return (
|
|
225
|
+
var o, s;
|
|
226
|
+
return (s = (o = this.$slots)[g("after_" + e.key)]) == null ? void 0 : s.call(o, {
|
|
210
227
|
...e,
|
|
211
228
|
model: this.form.model
|
|
212
229
|
});
|
|
213
230
|
},
|
|
214
231
|
defaultBefore: () => {
|
|
215
|
-
var o,
|
|
216
|
-
return (
|
|
232
|
+
var o, s;
|
|
233
|
+
return (s = (o = this.$slots)[g("before_" + e.key)]) == null ? void 0 : s.call(o, {
|
|
217
234
|
...e,
|
|
218
235
|
model: this.form.model
|
|
219
236
|
});
|
|
@@ -222,13 +239,13 @@ const ye = /* @__PURE__ */ R({
|
|
|
222
239
|
})]
|
|
223
240
|
});
|
|
224
241
|
}
|
|
225
|
-
})) ?
|
|
226
|
-
default: () => [
|
|
242
|
+
})) ? u : {
|
|
243
|
+
default: () => [u]
|
|
227
244
|
}), this.search && r(n("el-row"), {
|
|
228
245
|
class: ["el-form-right", this.isArrow ? "isArrow" : ""]
|
|
229
246
|
}, {
|
|
230
247
|
default: () => {
|
|
231
|
-
var e,
|
|
248
|
+
var e, f;
|
|
232
249
|
return [this.isArrow && r(n("el-button"), {
|
|
233
250
|
class: "el-form-right-operation",
|
|
234
251
|
text: !0,
|
|
@@ -236,9 +253,9 @@ const ye = /* @__PURE__ */ R({
|
|
|
236
253
|
onClick: this.unfold
|
|
237
254
|
}, {
|
|
238
255
|
default: () => [r(n("el-icon"), null, {
|
|
239
|
-
default: () => [this.packUp ? r(
|
|
256
|
+
default: () => [this.packUp ? r(Y, null, null) : r(Z, null, null)]
|
|
240
257
|
}), this.packUp ? "收起" : "展开"]
|
|
241
|
-
}), ((
|
|
258
|
+
}), ((f = (e = this.$slots).form_search) == null ? void 0 : f.call(e)) || r(L, null, [r(n("el-button"), m({
|
|
242
259
|
type: "primary",
|
|
243
260
|
onClick: () => this.$emit("SearchFn")
|
|
244
261
|
}, this.form.searchButton), {
|
|
@@ -246,7 +263,7 @@ const ye = /* @__PURE__ */ R({
|
|
|
246
263
|
var l;
|
|
247
264
|
return [((l = this.form.searchButton) == null ? void 0 : l.message) || "搜索"];
|
|
248
265
|
}
|
|
249
|
-
}), r(n("el-button"),
|
|
266
|
+
}), r(n("el-button"), m({
|
|
250
267
|
type: "primary",
|
|
251
268
|
plain: !0,
|
|
252
269
|
onClick: () => this.$emit("ResetFn")
|
|
@@ -257,11 +274,18 @@ const ye = /* @__PURE__ */ R({
|
|
|
257
274
|
}
|
|
258
275
|
})])];
|
|
259
276
|
}
|
|
277
|
+
}), this.$slots.form_search_operations && r(n("el-row"), {
|
|
278
|
+
class: "el-form-right-after"
|
|
279
|
+
}, {
|
|
280
|
+
default: () => {
|
|
281
|
+
var e, f;
|
|
282
|
+
return [(f = (e = this.$slots).form_search_operations) == null ? void 0 : f.call(e)];
|
|
283
|
+
}
|
|
260
284
|
})]
|
|
261
285
|
});
|
|
262
286
|
}
|
|
263
287
|
});
|
|
264
288
|
export {
|
|
265
|
-
|
|
289
|
+
Ce as default
|
|
266
290
|
};
|
|
267
291
|
//# sourceMappingURL=index.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","sources":["../../../../../packages/components/form/src/index.tsx"],"sourcesContent":["import {defineComponent, ref, computed, nextTick, toRefs, onBeforeUpdate} from 'vue'\nimport CustomInput from './input'\nimport CustomInputNumber from './input-number'\nimport CustomInputAutocomplete from './input-autocomplete'\nimport CustomSelect from './select'\nimport CustomSelectV2 from './select-v2'\nimport CustomSwitch from './switch'\nimport CustomDate from './date'\nimport CustomRadio from './radio'\nimport CustomSelectTree from './tree-select'\nimport CustomRate from './rate'\nimport CustomCheckbox from './checkbox'\nimport CustomCascader from './cascader'\n\nimport useWindowResize from '@packages/hooks/useWindowResize'\nimport {labelMouseEnter, valueMouseEnter, getTooltipValue, getSpanValue, formItemSlot, customPlaceholder, renderSlot} from '@packages/components/form/utils'\n\nimport {dataTransformRod, getUuid} from '@packages/utils/tools'\nimport {ElForm} from 'element-plus'\n\nimport {ArrowUp, ArrowDown} from '@element-plus/icons-vue'\n\n\nimport '@packages/assets/scss/dinert-form.scss'\n\nimport type {PropType} from 'vue'\nimport type {RewriteFormProps, CustomFormItemProps} from '@packages/components/form/types'\n\n\n// 展开还是收起状态\nexport default defineComponent({\n name: 'dinert-form',\n props: {\n form: {\n type: Object as PropType<RewriteFormProps>,\n default: () => ({})\n },\n search: {\n type: Boolean,\n default: true\n }\n },\n emits: ['UnFold', 'SearchFn', 'ResetFn'],\n setup(props, {emit}) {\n const {form} = toRefs(props)\n const packUp = ref(form.value.packUp === undefined)\n const isArrow = ref(false)\n const formRef = ref<InstanceType<typeof ElForm>>()\n const formTypeRef = ref<any>({})\n const setFormTypeRefs = (type: string, el: any) => {\n formTypeRef.value[type] = el\n }\n const formClass = ref('form_' + getUuid())\n\n onBeforeUpdate(() => {\n formTypeRef.value = {}\n })\n\n const formItemMap = computed(() => {\n const result: any = []\n Object.keys(form.value.formItem).forEach(key => {\n const value = form.value.formItem[key] as Partial<CustomFormItemProps>\n result.push({\n ...value,\n key: key,\n })\n })\n\n result.sort((a: any, b: any) => {\n return (a.sort || Infinity) - (b.sort || Infinity)\n })\n\n return result\n })\n\n const resizeForm = () => {\n let elFormLeft = document.querySelectorAll(`.${formClass.value} .el-form-left > div`) as any\n if (elFormLeft[0]) {\n isArrow.value = false\n nextTick(() => {\n const firstTop = elFormLeft[0].getBoundingClientRect().top\n const lastTop = elFormLeft[elFormLeft.length - 1].getBoundingClientRect().top\n const isHeight = firstTop !== lastTop\n if (isHeight) {\n isArrow.value = true\n } else {\n if (!packUp.value) {\n packUp.value = true\n }\n isArrow.value = false\n }\n elFormLeft = null\n })\n\n }\n }\n\n useWindowResize(() => {\n resizeForm()\n }, 100, true)\n\n\n const unfold = () => {\n if (packUp.value) {\n packUp.value = false\n } else {\n packUp.value = true\n }\n\n emit('UnFold', packUp.value)\n }\n\n\n return {\n formItemMap,\n formClass,\n formTypeRef,\n formRef,\n packUp,\n isArrow,\n\n setFormTypeRefs,\n unfold,\n }\n },\n render() {\n return (\n <el-form inline={true}\n {...this.form}\n ref={el => {this.formRef = el}}\n class={[this.formClass, this.packUp ? '' : 'packUp', 'dinert-form']} key={this.form.key}>\n\n <el-row {...this.form.row} class=\"el-form-left\">\n {/* eslint-disable-next-line array-callback-return, consistent-return */}\n { this.formItemMap.map((item: CustomFormItemProps) => {\n const style: any = {}\n let vif = typeof item.vif === 'function' ? item.vif(this.form.model) : item.vif\n vif = vif === undefined ? typeof this.form.vif === 'function' ? this.form.vif(this.form.model) : vif : vif\n vif = vif === undefined ? true : vif\n\n let show = typeof item.show === 'function' ? item.show(this.form.model) : item.show\n show = show === undefined ? true : show\n item.options = {placeholder: customPlaceholder(typeof item.label === 'function' ? item.label(this.form.model) : item.label, item.type), ...item.options}\n\n\n if (!show) {\n style.display = 'none'\n }\n if (vif) {\n item.required = item.required === undefined ? item.required || this.form.required : item.required\n item.showLabel = item.showLabel === undefined ? item.showLabel || this.form.showLabel : item.showLabel\n\n let rules = item.rules || []\n rules = item.required ? [{required: true, trigger: ['blur', 'change'], message: customPlaceholder(typeof item.label === 'function' ? item.label(this.form.model) : item.label, item.type)}].concat(rules as any) : rules\n rules = item.showLabel ? [] : rules\n const valDisabled = item.showLabel ? true : item.tempValueDisabled\n\n return (\n <el-col\n style= {style}\n class={[item.type, item.key]}\n key={item.key}\n {\n ...{\n // xl: 3, // ≥1920px\n // lg: 4, // ≥1200px\n // md: 8, // ≥992px\n // sm: 12, // ≥768px\n // xs: 24, // <768px\n ...this.form.colLayout,\n ...item.colLayout\n }\n }\n >\n <el-form-item\n key={item.key}\n prop={item.key}\n class={[item.labelWrap ? 'label-wrap' : '', item.showLabel || this.form.showLabel ? 'show-label' : '']}\n {...{\n ...item,\n label: typeof item.label === 'function' ? item.label(this.form.model) : item.label,\n rules: rules\n }}\n v-slots={{\n label: () => {\n return (\n <dinert-tooltip\n key={item.key}\n content={typeof item.label === 'function' ? item.label(this.form.model) : item.label}\n disabled={item.labelDisabled}\n onLabelMouseEnter={(e: MouseEvent) => labelMouseEnter(e, item, this)}\n >\n </dinert-tooltip>\n )\n },\n default: () => {\n return (\n <dinert-tooltip\n key={item.key}\n content={String(getTooltipValue(this.form.model[item.key], item))}\n disabled={valDisabled}\n item={item}\n onLabelMouseEnter={(e: MouseEvent) => valueMouseEnter(e, item, this.form.model[item.key], this)}\n v-slots={\n {\n // eslint-disable-next-line max-statements\n default: () => {\n\n const slots: any = {}\n\n let componentResult = <span>{dataTransformRod(getSpanValue(this.form.model[item.key], item))}</span>\n\n if (this.$slots[formItemSlot(item.key)]) {\n\n componentResult = (this.$slots[formItemSlot(item.key)]?.({...item, model: this.form.model}))\n } else if (item.showLabel || (this.form.showLabel && [true, undefined].includes(item.showLabel))) {\n return componentResult\n } else if (['input', 'textarea'].includes(item.type)) {\n renderSlot(['prefix', 'suffix', 'prepend', 'append'], this, slots, item)\n componentResult = (<CustomInput form={this.form} formItem={item} v-slots={slots}\n ref={el => this.setFormTypeRefs(item.key, el)}></CustomInput>)\n } else if (['input-number'].includes(item.type)) {\n renderSlot(['decrease-icon', 'increase-icon'], this, slots, item)\n componentResult = (<CustomInputNumber form={this.form} formItem={item} v-slots={slots}\n ref={el => this.setFormTypeRefs(item.key, el)}></CustomInputNumber>)\n } else if (['input-autocomplete'].includes(item.type)) {\n renderSlot(['prefix', 'suffix', 'prepend', 'append', 'loading'], this, slots, item)\n componentResult = (<CustomInputAutocomplete form={this.form} formItem={item} v-slots={slots}\n ref={el => this.setFormTypeRefs(item.key, el)}></CustomInputAutocomplete>)\n } else if (['select'].includes(item.type)) {\n renderSlot(['header', 'footer', 'prefix', 'empty', 'tag', 'loading', 'label'], this, slots, item)\n componentResult = (<CustomSelect form={this.form} formItem={item} v-slots={slots}\n ref={el => this.setFormTypeRefs(item.key, el)}></CustomSelect>)\n } else if (['select-v2'].includes(item.type)) {\n renderSlot(['header', 'footer', 'prefix', 'empty', 'tag', 'loading', 'label'], this, slots, item)\n componentResult = (<CustomSelectV2 form={this.form} formItem={item} v-slots={slots}\n ref={el => this.setFormTypeRefs(item.key, el)}></CustomSelectV2>)\n } else if (['switch'].includes(item.type)) {\n renderSlot(['active-action', 'inactive-action'], this, slots, item)\n componentResult = (<CustomSwitch form={this.form} formItem={item} v-slots={slots}\n ref={el => this.setFormTypeRefs(item.key, el)}></CustomSwitch>)\n } else if ([\n 'datetime',\n 'date',\n 'dates',\n 'week',\n 'month',\n 'year',\n 'years',\n 'datetimerange',\n 'daterange',\n 'monthrange',\n 'yearrange',\n ].includes(item.type)) {\n renderSlot(['range-separator', 'prev-month', 'next-month', 'prev-year', 'next-year'], this, slots, item)\n componentResult = (<CustomDate form={this.form} formItem={item} v-slots={slots}\n ref={el => this.setFormTypeRefs(item.key, el)}></CustomDate>)\n } else if (['radio', 'radio-button'].includes(item.type)) {\n componentResult = (<CustomRadio form={this.form} formItem={item} v-slots={slots}\n ref={el => this.setFormTypeRefs(item.key, el)}></CustomRadio>)\n } else if (['tree-select'].includes(item.type)) {\n renderSlot(['header', 'footer', 'prefix', 'empty', 'tag', 'loading', 'label'], this, slots, item)\n componentResult = (<CustomSelectTree form={this.form} formItem={item} v-slots={slots}\n ref={el => this.setFormTypeRefs(item.key, el)}></CustomSelectTree>)\n } else if (['rate'].includes(item.type)) {\n componentResult = (<CustomRate form={this.form} formItem={item} v-slots={slots}\n ref={el => this.setFormTypeRefs(item.key, el)}></CustomRate>)\n } else if (['checkbox', 'checkbox-button'].includes(item.type)) {\n componentResult = (<CustomCheckbox form={this.form} formItem={item} v-slots={slots}\n ref={el => this.setFormTypeRefs(item.key, el)}></CustomCheckbox>)\n } else if (['cascader'].includes(item.type)) {\n renderSlot(['empty'], this, slots, item)\n componentResult = (<CustomCascader ref={el => this.setFormTypeRefs(item.key, el)}\n form={this.form} formItem={item} v-slots={slots}></CustomCascader>)\n }\n\n return componentResult\n },\n defaultAfter: () => this.$slots[formItemSlot('after_' + item.key)]?.({...item, model: this.form.model}),\n defaultBefore: () => this.$slots[formItemSlot('before_' + item.key)]?.({...item, model: this.form.model}),\n }\n }\n >\n </dinert-tooltip>\n )\n }\n }}\n >\n </el-form-item>\n </el-col>\n )\n }\n\n })\n }\n </el-row>\n {\n this.search\n && <el-row class={['el-form-right', this.isArrow ? 'isArrow' : '']}>\n {this.isArrow\n && <el-button class=\"el-form-right-operation\" text type=\"primary\"\n onClick={this.unfold}\n >\n <el-icon>\n {this.packUp ? <ArrowUp/> : <ArrowDown/>}\n </el-icon>\n {this.packUp ? '收起' : '展开'}\n </el-button>\n }\n {this.$slots.form_search?.()\n || (\n <>\n <el-button type=\"primary\" onClick={() => this.$emit('SearchFn')} {...this.form.searchButton}>{this.form.searchButton?.message || '搜索'}</el-button>\n <el-button type=\"primary\" plain\n onClick={() => this.$emit('ResetFn')}\n {...this.form.resetButton}\n >{this.form.searchButton?.message || '重置'}</el-button>\n </>\n )\n }\n </el-row>\n }\n </el-form>\n )\n }\n})\n"],"names":["_isSlot","s","Object","prototype","toString","call","_isVNode","defineComponent","name","props","form","type","default","search","Boolean","emits","setup","emit","toRefs","packUp","ref","value","undefined","isArrow","formRef","formTypeRef","setFormTypeRefs","el","formClass","getUuid","onBeforeUpdate","formItemMap","computed","result","keys","formItem","forEach","key","push","sort","a","b","Infinity","resizeForm","elFormLeft","document","querySelectorAll","nextTick","firstTop","getBoundingClientRect","top","lastTop","length","useWindowResize","unfold","render","_slot","_createVNode","_resolveComponent","_mergeProps","row","map","item","style","vif","model","show","options","placeholder","customPlaceholder","label","display","required","showLabel","rules","trigger","message","concat","valDisabled","tempValueDisabled","colLayout","labelWrap","labelDisabled","e","labelMouseEnter","String","getTooltipValue","valueMouseEnter","slots","componentResult","dataTransformRod","getSpanValue","$slots","formItemSlot","_b","_a","includes","renderSlot","CustomInput","CustomInputNumber","CustomInputAutocomplete","CustomSelect","CustomSelectV2","CustomSwitch","CustomDate","CustomRadio","CustomSelectTree","CustomRate","CustomCheckbox","CustomCascader","defaultAfter","defaultBefore","ArrowUp","ArrowDown","form_search","_Fragment","onClick","$emit","searchButton","resetButton"],"mappings":";;;;;;;;;;;;;;;;;;AAuB+C,SAAAA,EAAAC,GAAA;AAAA,SAAA,OAAAA,KAAA,cAAAC,OAAAC,UAAAC,SAAAC,KAAAJ,CAAA,MAAAK,qBAAAA,CAAAA,EAAAL,CAAA;AAAA;AAO/C,MAAeM,uBAAgB;AAAA,EAC3BC,MAAM;AAAA,EACNC,OAAO;AAAA,IACHC,MAAM;AAAA,MACFC,MAAMT;AAAAA,MACNU,SAASA,OAAO,CAAA;AAAA,IACnB;AAAA,IACDC,QAAQ;AAAA,MACJF,MAAMG;AAAAA,MACNF,SAAS;AAAA,IACb;AAAA,EACH;AAAA,EACDG,OAAO,CAAC,UAAU,YAAY,SA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AAC,EAAA,SAAA,GAAA,MAAA;AAAA,cAAA9C,SAAAA,MAGf,CAAA,KAAKO,SAAMsC,EAAAuD,GAAA,MAAA,IAAA,IAAAvD,EAAAwD,GAA4B,MAAA,IAAA,CAAA;AAAA,YAAA,CAAA,GAE3C,KAAK9F,SAAS,OAAO,IAAI;AAAA,UAAA,CAAA,KAG7B2E,KAAAC,IAAA,KAAKH,QAAOsB,gBAAZ,gBAAApB,EAAA,KAAAC,OAA2BtC,EAAA0D,GAAA,MAAA,CAAA1D,EAAAC,gBAAAC,EAAA;AAAA,YAAA,MAAA;AAAA,YAAA,SAGmByD,MAAM,KAAKC,MAAM,UAAU;AAAA,UAAC,GAAM,KAAK3G,KAAK4G,YAAY,GAAA;AAAA,YAAA1G,SAAAA,MAAA;;AAAA,wBAAGmF,IAAA,KAAKrF,KAAK4G,iBAAV,gBAAAvB,EAAwBnB,YAAW,IAAI;AAAA;AAAA,UAAA,CAAA,GAAAnB,EAAAC,EAAA,WAAA,GAAAC,EAAA;AAAA,YAAA,MAAA;AAAA,YAAA,OAAA;AAAA,YAAA,SAExHyD,MAAM,KAAKC,MAAM,SAAS;AAAA,UAAC,GAChC,KAAK3G,KAAK6G,WAAW,GAAA;AAAA,YAAA3G,SAAAA,MAAA;;AAAA,wBAC3BmF,IAAA,KAAKrF,KAAK4G,iBAAV,gBAAAvB,EAAwBnB,YAAW,IAAI;AAAA;AAAA,UAEhD,CAAA,CAAA,CAAA,CAAA;AAAA;AAAA,OAEA,CAAA;AAAA,IAAA,CAAA;AAAA,EAIrB;AACJ,CAAC;"}
|
|
1
|
+
{"version":3,"file":"index.mjs","sources":["../../../../../packages/components/form/src/index.tsx"],"sourcesContent":["import {defineComponent, ref, computed, nextTick, toRefs, onBeforeUpdate, withModifiers} from 'vue'\nimport CustomInput from './input'\nimport CustomInputNumber from './input-number'\nimport CustomInputAutocomplete from './input-autocomplete'\nimport CustomSelect from './select'\nimport CustomSelectV2 from './select-v2'\nimport CustomSwitch from './switch'\nimport CustomDate from './date'\nimport CustomRadio from './radio'\nimport CustomSelectTree from './tree-select'\nimport CustomRate from './rate'\nimport CustomCheckbox from './checkbox'\nimport CustomCascader from './cascader'\nimport CustomSlider from './slider'\nimport CustomTimePicker from './time-picker'\nimport CustomTimeSelect from './time-select'\n\nimport useWindowResize from '@packages/hooks/useWindowResize'\nimport {labelMouseEnter, valueMouseEnter, getTooltipValue, getSpanValue, formItemSlot, customPlaceholder, renderSlot} from '@packages/components/form/utils'\n\nimport {dataTransformRod, getUuid} from '@packages/utils/tools'\nimport {ElForm} from 'element-plus'\n\nimport {ArrowUp, ArrowDown} from '@element-plus/icons-vue'\n\n\nimport '@packages/assets/scss/dinert-form.scss'\n\nimport type {PropType} from 'vue'\nimport type {RewriteFormProps, CustomFormItemProps} from '@packages/components/form/types'\n\n// 展开还是收起状态\nexport default defineComponent({\n name: 'dinert-form',\n props: {\n form: {\n type: Object as PropType<RewriteFormProps>,\n default: () => ({})\n },\n search: {\n type: Boolean,\n default: true\n }\n },\n emits: ['UnFold', 'SearchFn', 'ResetFn'],\n setup(props, {emit}) {\n const {form} = toRefs(props)\n const packUp = ref(form.value.packUp === undefined)\n const isArrow = ref(false)\n const formRef = ref<InstanceType<typeof ElForm>>()\n const formTypeRef = ref<any>({})\n const setFormTypeRefs = (type: string, el: any) => {\n formTypeRef.value[type] = el\n }\n const formClass = ref('form_' + getUuid())\n\n onBeforeUpdate(() => {\n formTypeRef.value = {}\n })\n\n const formItemMap = computed(() => {\n const result: any = []\n Object.keys(form.value.formItem).forEach(key => {\n const value = form.value.formItem[key] as Partial<CustomFormItemProps>\n result.push({\n ...value,\n key: key,\n })\n })\n\n result.sort((a: any, b: any) => {\n return (a.sort || Infinity) - (b.sort || Infinity)\n })\n\n return result\n })\n\n const resizeForm = () => {\n let elFormLeft = document.querySelectorAll(`.${formClass.value} .el-form-left > div`) as any\n if (elFormLeft[0]) {\n isArrow.value = false\n nextTick(() => {\n const firstTop = elFormLeft[0].getBoundingClientRect().top\n const lastTop = elFormLeft[elFormLeft.length - 1].getBoundingClientRect().top\n const isHeight = firstTop !== lastTop\n if (isHeight) {\n isArrow.value = true\n } else {\n if (!packUp.value) {\n packUp.value = true\n }\n isArrow.value = false\n }\n elFormLeft = null\n })\n\n }\n }\n\n useWindowResize(() => {\n resizeForm()\n }, 100, true)\n\n\n const unfold = () => {\n if (packUp.value) {\n packUp.value = false\n } else {\n packUp.value = true\n }\n\n emit('UnFold', packUp.value)\n }\n\n\n return {\n formItemMap,\n formClass,\n formTypeRef,\n formRef,\n packUp,\n isArrow,\n\n setFormTypeRefs,\n unfold,\n }\n },\n render() {\n return (\n <el-form inline={true}\n {...this.form}\n ref={el => {this.formRef = el}}\n class={[this.formClass, this.packUp ? '' : 'packUp', 'dinert-form']}\n onSubmit={withModifiers(() => undefined, ['stop', 'prevent'])}\n key={this.form.key}>\n\n <el-row {...this.form.row} class=\"el-form-left\">\n {/* eslint-disable-next-line array-callback-return, consistent-return */}\n { this.formItemMap.map((item: CustomFormItemProps) => {\n const style: any = {}\n let vif = typeof item.vif === 'function' ? item.vif(this.form.model) : item.vif\n vif = vif === undefined ? typeof this.form.vif === 'function' ? this.form.vif(this.form.model) : vif : vif\n vif = vif === undefined ? true : vif\n\n let show = typeof item.show === 'function' ? item.show(this.form.model) : item.show\n show = show === undefined ? true : show\n item.options = {placeholder: customPlaceholder(typeof item.label === 'function' ? item.label(this.form.model) : item.label, item.type), ...item.options}\n\n\n if (!show) {\n style.display = 'none'\n }\n if (vif) {\n item.required = item.required === undefined ? item.required || this.form.required : item.required\n item.showLabel = item.showLabel === undefined ? item.showLabel || this.form.showLabel : item.showLabel\n\n let rules = item.rules || []\n rules = item.required ? [{required: true, trigger: ['blur', 'change'], message: customPlaceholder(typeof item.label === 'function' ? item.label(this.form.model) : item.label, item.type)}].concat(rules as any) : rules\n rules = item.showLabel ? [] : rules\n const valDisabled = item.showLabel ? true : item.tempValueDisabled\n\n return (\n <el-col\n style= {style}\n class={[item.type, item.key]}\n key={item.key}\n {\n ...{\n // xl: 3, // ≥1920px\n // lg: 4, // ≥1200px\n // md: 8, // ≥992px\n // sm: 12, // ≥768px\n // xs: 24, // <768px\n ...this.form.colLayout,\n ...item.colLayout\n }\n }\n >\n <el-form-item\n key={item.key}\n prop={item.key}\n class={[item.labelWrap ? 'label-wrap' : '', item.showLabel || this.form.showLabel ? 'show-label' : '']}\n {...{\n ...item,\n label: typeof item.label === 'function' ? item.label(this.form.model) : item.label,\n rules: rules\n }}\n v-slots={{\n label: () => {\n return (\n <dinert-tooltip\n key={item.key}\n content={typeof item.label === 'function' ? item.label(this.form.model) : item.label}\n disabled={item.labelDisabled}\n onLabelMouseEnter={(e: MouseEvent) => labelMouseEnter(e, item, this)}\n >\n </dinert-tooltip>\n )\n },\n default: () => {\n return (\n <dinert-tooltip\n key={item.key}\n content={String(getTooltipValue(this.form.model[item.key], item))}\n disabled={valDisabled}\n item={item}\n onLabelMouseEnter={(e: MouseEvent) => valueMouseEnter(e, item, this.form.model[item.key], this)}\n v-slots={\n {\n // eslint-disable-next-line max-statements\n default: () => {\n\n const slots: any = {}\n\n let componentResult = <span>{dataTransformRod(getSpanValue(this.form.model[item.key], item))}</span>\n\n if (this.$slots[formItemSlot(item.key)]) {\n\n componentResult = (this.$slots[formItemSlot(item.key)]?.({...item, model: this.form.model}))\n } else if (item.showLabel || (this.form.showLabel && [true, undefined].includes(item.showLabel))) {\n return componentResult\n } else if (['input', 'textarea'].includes(item.type)) {\n renderSlot(['prefix', 'suffix', 'prepend', 'append'], this, slots, item)\n componentResult = (<CustomInput form={this.form} formItem={item} v-slots={slots}\n ref={el => this.setFormTypeRefs(item.key, el)}></CustomInput>)\n } else if (['input-number'].includes(item.type)) {\n renderSlot(['decrease-icon', 'increase-icon'], this, slots, item)\n componentResult = (<CustomInputNumber form={this.form} formItem={item} v-slots={slots}\n ref={el => this.setFormTypeRefs(item.key, el)}></CustomInputNumber>)\n } else if (['input-autocomplete'].includes(item.type)) {\n renderSlot(['prefix', 'suffix', 'prepend', 'append', 'loading'], this, slots, item)\n componentResult = (<CustomInputAutocomplete form={this.form} formItem={item} v-slots={slots}\n ref={el => this.setFormTypeRefs(item.key, el)}></CustomInputAutocomplete>)\n } else if (['select'].includes(item.type)) {\n renderSlot(['header', 'footer', 'prefix', 'empty', 'tag', 'loading', 'label'], this, slots, item)\n componentResult = (<CustomSelect form={this.form} formItem={item} v-slots={slots}\n ref={el => this.setFormTypeRefs(item.key, el)}></CustomSelect>)\n } else if (['select-v2'].includes(item.type)) {\n renderSlot(['header', 'footer', 'prefix', 'empty', 'tag', 'loading', 'label'], this, slots, item)\n componentResult = (<CustomSelectV2 form={this.form} formItem={item} v-slots={slots}\n ref={el => this.setFormTypeRefs(item.key, el)}></CustomSelectV2>)\n } else if (['switch'].includes(item.type)) {\n renderSlot(['active-action', 'inactive-action'], this, slots, item)\n componentResult = (<CustomSwitch form={this.form} formItem={item} v-slots={slots}\n ref={el => this.setFormTypeRefs(item.key, el)}></CustomSwitch>)\n } else if ([\n 'datetime',\n 'date',\n 'dates',\n 'week',\n 'month',\n 'year',\n 'years',\n 'datetimerange',\n 'daterange',\n 'monthrange',\n 'yearrange',\n ].includes(item.type)) {\n renderSlot(['range-separator', 'prev-month', 'next-month', 'prev-year', 'next-year'], this, slots, item)\n componentResult = (<CustomDate form={this.form} formItem={item} v-slots={slots}\n ref={el => this.setFormTypeRefs(item.key, el)}></CustomDate>)\n } else if (['radio', 'radio-button'].includes(item.type)) {\n componentResult = (<CustomRadio form={this.form} formItem={item} v-slots={slots}\n ref={el => this.setFormTypeRefs(item.key, el)}></CustomRadio>)\n } else if (['tree-select'].includes(item.type)) {\n renderSlot(['header', 'footer', 'prefix', 'empty', 'tag', 'loading', 'label'], this, slots, item)\n componentResult = (<CustomSelectTree form={this.form} formItem={item} v-slots={slots}\n ref={el => this.setFormTypeRefs(item.key, el)}></CustomSelectTree>)\n } else if (['rate'].includes(item.type)) {\n componentResult = (<CustomRate form={this.form} formItem={item} v-slots={slots}\n ref={el => this.setFormTypeRefs(item.key, el)}></CustomRate>)\n } else if (['checkbox', 'checkbox-button'].includes(item.type)) {\n componentResult = (<CustomCheckbox form={this.form} formItem={item} v-slots={slots}\n ref={el => this.setFormTypeRefs(item.key, el)}></CustomCheckbox>)\n } else if (['cascader'].includes(item.type)) {\n renderSlot(['empty'], this, slots, item)\n componentResult = (<CustomCascader ref={el => this.setFormTypeRefs(item.key, el)}\n form={this.form} formItem={item} v-slots={slots}></CustomCascader>)\n } else if (['slider'].includes(item.type)) {\n componentResult = (<CustomSlider ref={el => this.setFormTypeRefs(item.key, el)}\n form={this.form} formItem={item} v-slots={slots}></CustomSlider>)\n } else if (['time-picker'].includes(item.type)) {\n componentResult = (<CustomTimePicker ref={el => this.setFormTypeRefs(item.key, el)}\n form={this.form} formItem={item} v-slots={slots}></CustomTimePicker>)\n } else if (['time-select'].includes(item.type)) {\n componentResult = (<CustomTimeSelect ref={el => this.setFormTypeRefs(item.key, el)}\n form={this.form} formItem={item} v-slots={slots}></CustomTimeSelect>)\n }\n\n return componentResult\n },\n defaultAfter: () => this.$slots[formItemSlot('after_' + item.key)]?.({...item, model: this.form.model}),\n defaultBefore: () => this.$slots[formItemSlot('before_' + item.key)]?.({...item, model: this.form.model}),\n }\n }\n >\n </dinert-tooltip>\n )\n }\n }}\n >\n </el-form-item>\n </el-col>\n )\n }\n\n })\n }\n </el-row>\n {\n this.search\n && <el-row class={['el-form-right', this.isArrow ? 'isArrow' : '']}>\n {this.isArrow\n && <el-button class=\"el-form-right-operation\" text type=\"primary\"\n onClick={this.unfold}\n >\n <el-icon>\n {this.packUp ? <ArrowUp/> : <ArrowDown/>}\n </el-icon>\n {this.packUp ? '收起' : '展开'}\n </el-button>\n }\n {this.$slots.form_search?.()\n || (\n <>\n <el-button type=\"primary\" onClick={() => this.$emit('SearchFn')} {...this.form.searchButton}>{this.form.searchButton?.message || '搜索'}</el-button>\n <el-button type=\"primary\" plain\n onClick={() => this.$emit('ResetFn')}\n {...this.form.resetButton}\n >{this.form.searchButton?.message || '重置'}</el-button>\n </>\n )\n }\n </el-row>\n }\n {\n this.$slots.form_search_operations\n && <el-row class={'el-form-right-after'}>\n {this.$slots.form_search_operations?.()}\n </el-row>\n }\n </el-form>\n )\n }\n})\n"],"names":["_isSlot","s","Object","prototype","toString","call","_isVNode","defineComponent","name","props","form","type","default","search","Boolean","emits","setup","emit","toRefs","packUp","ref","value","undefined","isArrow","formRef","formTypeRef","setFormTypeRefs","el","formClass","getUuid","onBeforeUpdate","formItemMap","computed","result","keys","formItem","forEach","key","push","sort","a","b","Infinity","resizeForm","elFormLeft","document","querySelectorAll","nextTick","firstTop","getBoundingClientRect","top","lastTop","length","useWindowResize","unfold","render","_slot","_createVNode","_resolveComponent","_mergeProps","withModifiers","row","map","item","style","vif","model","show","options","placeholder","customPlaceholder","label","display","required","showLabel","rules","trigger","message","concat","valDisabled","tempValueDisabled","colLayout","labelWrap","labelDisabled","e","labelMouseEnter","String","getTooltipValue","valueMouseEnter","slots","componentResult","dataTransformRod","getSpanValue","$slots","formItemSlot","_b","_a","includes","renderSlot","CustomInput","CustomInputNumber","CustomInputAutocomplete","CustomSelect","CustomSelectV2","CustomSwitch","CustomDate","CustomRadio","CustomSelectTree","CustomRate","CustomCheckbox","CustomCascader","CustomSlider","CustomTimePicker","CustomTimeSelect","defaultAfter","defaultBefore","ArrowUp","ArrowDown","form_search","_Fragment","onClick","$emit","searchButton","resetButton","form_search_operations"],"mappings":";;;;;;;;;;;;;;;;;;;;;AA0B+C,SAAAA,GAAAC,GAAA;AAAA,SAAA,OAAAA,KAAA,cAAAC,OAAAC,UAAAC,SAAAC,KAAAJ,CAAA,MAAAK,qBAAAA,CAAAA,EAAAL,CAAA;AAAA;AAM/C,MAAeM,uBAAgB;AAAA,EAC3BC,MAAM;AAAA,EACNC,OAAO;AAAA,IACHC,MAAM;AAAA,MACFC,MAAMT;AAAAA,MACNU,SAASA,OAAO,CAAA;AAAA,IACnB;AA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AC,EAAA;AAAA,YAAA,MAAA;AAAA,YAAA,SAGmB6D,MAAM,KAAKC,MAAM,UAAU;AAAA,UAAC,GAAM,KAAK/G,KAAKgH,YAAY,GAAA;AAAA,YAAA9G,SAAAA,MAAA;;AAAA,wBAAGoF,IAAA,KAAKtF,KAAKgH,iBAAV,gBAAA1B,EAAwBnB,YAAW,IAAI;AAAA;AAAA,UAAA,CAAA,GAAApB,EAAAC,EAAA,WAAA,GAAAC,EAAA;AAAA,YAAA,MAAA;AAAA,YAAA,OAAA;AAAA,YAAA,SAExH6D,MAAM,KAAKC,MAAM,SAAS;AAAA,UAAC,GAChC,KAAK/G,KAAKiH,WAAW,GAAA;AAAA,YAAA/G,SAAAA,MAAA;;AAAA,wBAC3BoF,IAAA,KAAKtF,KAAKgH,iBAAV,gBAAA1B,EAAwBnB,YAAW,IAAI;AAAA;AAAA,UAEhD,CAAA,CAAA,CAAA,CAAA;AAAA;AAAA,OAEA,GAGL,KAAKgB,OAAO+B,0BAAsBnE,EAAAC,EAAA,QAAA,GAAA;AAAA,QAAA,OAC5B;AAAA,MAAqB,GAAA;AAAA,QAAA9C,SAAAA,MAAAA;;AAClC,mBAAAmF,KAAAC,IAAA,KAAKH,QAAO+B,2BAAZ,gBAAA7B,EAAA,KAAAC,EAAsC;AAAA;AAAA,OAClC,CAAA;AAAA,IAAA,CAAA;AAAA,EAIb;AACJ,CAAC;"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { defineComponent as t, ref as r, computed as s, createVNode as m, resolveComponent as n, mergeProps as i } from "vue";
|
|
2
|
+
const f = /* @__PURE__ */ t({
|
|
3
|
+
name: "dinert-slider",
|
|
4
|
+
props: {
|
|
5
|
+
form: {
|
|
6
|
+
type: Object,
|
|
7
|
+
default: () => ({})
|
|
8
|
+
},
|
|
9
|
+
formItem: {
|
|
10
|
+
type: Object,
|
|
11
|
+
default: () => ({})
|
|
12
|
+
}
|
|
13
|
+
},
|
|
14
|
+
setup(e) {
|
|
15
|
+
const o = r(null);
|
|
16
|
+
return {
|
|
17
|
+
options: s(() => e.formItem.options || {}),
|
|
18
|
+
sliderRef: o
|
|
19
|
+
};
|
|
20
|
+
},
|
|
21
|
+
render() {
|
|
22
|
+
return m(n("el-slider"), i({
|
|
23
|
+
modelValue: this.form.model[this.formItem.key],
|
|
24
|
+
"onUpdate:modelValue": (e) => this.form.model[this.formItem.key] = e
|
|
25
|
+
}, this.options, {
|
|
26
|
+
ref: (e) => {
|
|
27
|
+
this.sliderRef = e;
|
|
28
|
+
}
|
|
29
|
+
}), this.$slots);
|
|
30
|
+
}
|
|
31
|
+
});
|
|
32
|
+
export {
|
|
33
|
+
f as default
|
|
34
|
+
};
|
|
35
|
+
//# sourceMappingURL=slider.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"slider.mjs","sources":["../../../../../packages/components/form/src/slider.tsx"],"sourcesContent":["import {computed, defineComponent, ref} from 'vue'\n\n\nimport type {RewriteFormProps, CustomFormItemProps} from '@packages/components/form/types'\nimport type {PropType} from 'vue'\n\n\nexport default defineComponent({\n name: 'dinert-slider',\n props: {\n form: {\n type: Object as PropType<RewriteFormProps>,\n default: () => ({})\n },\n formItem: {\n type: Object as PropType<CustomFormItemProps>,\n default: () => ({})\n },\n },\n setup(props) {\n const sliderRef = ref(null)\n const options = computed(() => {\n const options = props.formItem.options || {}\n return options\n })\n\n return {\n options,\n sliderRef\n }\n },\n render() {\n return (\n <el-slider\n v-model={this.form.model[this.formItem.key]}\n {...this.options}\n v-slots={this.$slots}\n ref={el => {this.sliderRef = el}}\n >\n </el-slider>\n )\n }\n})\n\n"],"names":["defineComponent","name","props","form","type","Object","default","formItem","setup","sliderRef","ref","options","computed","render","_createVNode","_resolveComponent","_mergeProps","model","key","$event","el","$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;AACT,UAAMO,IAAYC,EAAI,IAAI;AAM1B,WAAO;AAAA,MACHC,SANYC,EAAS,MACLV,EAAMK,SAASI,WAAW,CAAA,CAE7C;AAAA,MAIGF,WAAAA;AAAAA;EAEP;AAAA,EACDI,SAAS;AACL,WAAAC,EAAAC,EAAA,WAAA,GAAAC,EAAA;AAAA,MAAA,YAEiB,KAAKb,KAAKc,MAAM,KAAKV,SAASW,GAAG;AAAA,MAAC,uBAAAC,CAAAA,MAAlC,KAAKhB,KAAKc,MAAM,KAAKV,SAASW,GAAG,IAACC;AAAAA,OACvC,KAAKR,SAAO;AAAA,MAAA,KAEXS,CAAAA,MAAM;AAAC,aAAKX,YAAYW;AAAAA,MAAE;AAAA,KADtB,GAAA,KAAKC,MAAM;AAAA,EAKhC;AACJ,CAAC;"}
|