orion-design 0.1.5 → 0.1.7
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/Throne/index.d.ts +10 -0
- package/dist/Throne/index.js +20 -0
- package/dist/Throne/index.js.map +1 -0
- package/dist/_commonjsHelpers-DaMA6jEr.js +9 -0
- package/dist/_commonjsHelpers-DaMA6jEr.js.map +1 -0
- package/dist/components/Button/Button.vue.d.ts +15 -1
- package/dist/components/Button/ButtonGroup/ButtonGroup.d.ts +4 -0
- package/dist/components/Button/ButtonGroup/ButtonGroup.js +2 -0
- package/dist/components/Button/ButtonGroup/ButtonGroup.js.map +1 -0
- package/dist/components/Button/ButtonGroup/ButtonGroup.vue.d.ts +17 -0
- package/dist/components/Button/ButtonGroup/index.d.ts +1 -0
- package/dist/components/Button/ButtonGroup/index.js +2 -0
- package/dist/components/Button/ButtonGroup/index.js.map +1 -0
- package/dist/components/Button/index.d.ts +21 -4
- package/dist/components/Button/index.js +37 -19
- package/dist/components/Button/index.js.map +1 -1
- package/dist/components/Form/ButtonGroup/ButtonGroup.d.ts +5 -0
- package/dist/components/Form/ButtonGroup/ButtonGroup.js +2 -0
- package/dist/components/Form/ButtonGroup/ButtonGroup.js.map +1 -0
- package/dist/components/Form/ButtonGroup/ButtonGroup.vue.d.ts +17 -0
- package/dist/components/Form/ButtonGroup/index.d.ts +1 -0
- package/dist/components/Form/ButtonGroup/index.js +2 -0
- package/dist/components/Form/ButtonGroup/index.js.map +1 -0
- package/dist/components/Form/Checkbox/Checkbox.d.ts +9 -0
- package/dist/components/Form/Checkbox/Checkbox.js +2 -0
- package/dist/components/Form/Checkbox/Checkbox.js.map +1 -0
- package/dist/components/Form/Checkbox/Checkbox.vue.d.ts +3 -0
- package/dist/components/Form/Checkbox/index.d.ts +1 -0
- package/dist/components/Form/Checkbox/index.js +2 -0
- package/dist/components/Form/Checkbox/index.js.map +1 -0
- package/dist/components/Form/CheckboxGroup/CheckboxGroup.d.ts +14 -0
- package/dist/components/Form/CheckboxGroup/CheckboxGroup.js +2 -0
- package/dist/components/Form/CheckboxGroup/CheckboxGroup.js.map +1 -0
- package/dist/components/Form/CheckboxGroup/CheckboxGroup.vue.d.ts +3 -0
- package/dist/components/Form/CheckboxGroup/index.d.ts +1 -0
- package/dist/components/Form/CheckboxGroup/index.js +2 -0
- package/dist/components/Form/CheckboxGroup/index.js.map +1 -0
- package/dist/components/Form/DateInput/DateInput.d.ts +17 -0
- package/dist/components/Form/DateInput/DateInput.js +2 -0
- package/dist/components/Form/DateInput/DateInput.js.map +1 -0
- package/dist/components/Form/DateInput/DateInput.vue.d.ts +3 -0
- package/dist/components/Form/DateInput/index.d.ts +1 -0
- package/dist/components/Form/DateInput/index.js +2 -0
- package/dist/components/Form/DateInput/index.js.map +1 -0
- package/dist/components/Form/DiyItem/DiyItem.d.ts +9 -0
- package/dist/components/Form/DiyItem/DiyItem.js +2 -0
- package/dist/components/Form/DiyItem/DiyItem.js.map +1 -0
- package/dist/components/Form/DiyItem/DiyItem.vue.d.ts +17 -0
- package/dist/components/Form/DiyItem/index.d.ts +1 -0
- package/dist/components/Form/DiyItem/index.js +2 -0
- package/dist/components/Form/DiyItem/index.js.map +1 -0
- package/dist/components/Form/FileInput/FileInput.d.ts +10 -0
- package/dist/components/Form/FileInput/FileInput.js +2 -0
- package/dist/components/Form/FileInput/FileInput.js.map +1 -0
- package/dist/components/Form/FileInput/FileInput.vue.d.ts +451 -0
- package/dist/components/Form/FileInput/index.d.ts +1 -0
- package/dist/components/Form/FileInput/index.js +2 -0
- package/dist/components/Form/FileInput/index.js.map +1 -0
- package/dist/components/Form/Form.d.ts +1 -0
- package/dist/components/Form/Form.js.map +1 -1
- package/dist/components/Form/Form.vue.d.ts +10 -10
- package/dist/components/Form/MultiSelect/MultiSelect.d.ts +15 -0
- package/dist/components/Form/MultiSelect/MultiSelect.js +2 -0
- package/dist/components/Form/MultiSelect/MultiSelect.js.map +1 -0
- package/dist/components/Form/MultiSelect/MultiSelect.vue.d.ts +3 -0
- package/dist/components/Form/MultiSelect/index.d.ts +1 -0
- package/dist/components/Form/MultiSelect/index.js +2 -0
- package/dist/components/Form/MultiSelect/index.js.map +1 -0
- package/dist/components/Form/PasswordInput/PasswordInput.d.ts +0 -2
- package/dist/components/Form/RadioGroup/RadioGroup.d.ts +14 -0
- package/dist/components/Form/RadioGroup/RadioGroup.js +2 -0
- package/dist/components/Form/RadioGroup/RadioGroup.js.map +1 -0
- package/dist/components/Form/RadioGroup/RadioGroup.vue.d.ts +3 -0
- package/dist/components/Form/RadioGroup/index.d.ts +1 -0
- package/dist/components/Form/RadioGroup/index.js +2 -0
- package/dist/components/Form/RadioGroup/index.js.map +1 -0
- package/dist/components/Form/SingleSelect/SingleSelect.d.ts +17 -0
- package/dist/components/Form/SingleSelect/SingleSelect.js +2 -0
- package/dist/components/Form/SingleSelect/SingleSelect.js.map +1 -0
- package/dist/components/Form/SingleSelect/SingleSelect.vue.d.ts +3 -0
- package/dist/components/Form/SingleSelect/index.d.ts +1 -0
- package/dist/components/Form/SingleSelect/index.js +2 -0
- package/dist/components/Form/SingleSelect/index.js.map +1 -0
- package/dist/components/Form/StringInput/StringInput.d.ts +0 -2
- package/dist/components/Form/Switch/Switch.d.ts +9 -0
- package/dist/components/Form/Switch/Switch.js +2 -0
- package/dist/components/Form/Switch/Switch.js.map +1 -0
- package/dist/components/Form/Switch/Switch.vue.d.ts +3 -0
- package/dist/components/Form/Switch/index.d.ts +1 -0
- package/dist/components/Form/Switch/index.js +2 -0
- package/dist/components/Form/Switch/index.js.map +1 -0
- package/dist/components/Form/Textarea/Textarea.d.ts +0 -2
- package/dist/components/Form/hooks/useForm.d.ts +5 -3
- package/dist/components/Form/hooks/useForm.js +40 -17
- package/dist/components/Form/hooks/useForm.js.map +1 -1
- package/dist/components/Form/index.d.ts +37 -6
- package/dist/components/Form/index.js +612 -100
- package/dist/components/Form/index.js.map +1 -1
- package/dist/components/Form/utils/index.d.ts +8 -0
- package/dist/components/Form/utils/index.js +26 -0
- package/dist/components/Form/utils/index.js.map +1 -0
- package/dist/components/Modal/index.d.ts +1 -1
- package/dist/components/Pagetable/Pagetable.d.ts +29 -17
- package/dist/components/Pagetable/columns/PagetableCellButton.d.ts +24 -0
- package/dist/components/Pagetable/columns/PagetableColumnButtongroup.d.ts +78 -0
- package/dist/components/Pagetable/columns/{PagetableDatecolumn.d.ts → PagetableColumnDate.d.ts} +17 -4
- package/dist/components/Pagetable/columns/PagetableColumnDiy.d.ts +78 -0
- package/dist/components/Pagetable/columns/PagetableColumnIndex.d.ts +5 -0
- package/dist/components/Pagetable/columns/PagetableColumnMultiselect.d.ts +109 -0
- package/dist/components/Pagetable/columns/PagetableColumnNumber.d.ts +114 -0
- package/dist/components/Pagetable/columns/PagetableColumnSingleselect.d.ts +109 -0
- package/dist/components/Pagetable/columns/{PagetableStringcolumn.d.ts → PagetableColumnString.d.ts} +17 -4
- package/dist/components/Pagetable/columns/PagetableColumngroup.d.ts +35 -0
- package/dist/components/Pagetable/hooks/useColumns.d.ts +1 -0
- package/dist/components/Pagetable/hooks/useColumns.js +96 -0
- package/dist/components/Pagetable/hooks/useColumns.js.map +1 -0
- package/dist/components/Pagetable/index.d.ts +42 -17
- package/dist/components/Pagetable/index.js +496 -119
- package/dist/components/Pagetable/index.js.map +1 -1
- package/dist/components/Pagetable/utils/index.d.ts +15 -0
- package/dist/components/Pagetable/utils/index.js +169 -0
- package/dist/components/Pagetable/utils/index.js.map +1 -0
- package/dist/components/Space/index.d.ts +3 -3
- package/dist/components/_util/type.d.ts +4 -0
- package/dist/components/_util/type.js +8 -4
- package/dist/components/_util/type.js.map +1 -1
- package/dist/components/_util/vue/size.d.ts +1 -1
- package/dist/components/components.js +15 -14
- package/dist/components/components.js.map +1 -1
- package/dist/components/index.js +20 -19
- package/dist/components/index.js.map +1 -1
- package/dist/components/types.d.ts +11 -0
- package/dist/components/types.js +2 -0
- package/dist/components/types.js.map +1 -0
- package/dist/components-CutWiB7Q.js +68 -0
- package/dist/components-CutWiB7Q.js.map +1 -0
- package/dist/index-BbsXWo7C.js +44 -0
- package/dist/index-BbsXWo7C.js.map +1 -0
- package/dist/index.css +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.js +22 -19
- package/dist/index.js.map +1 -1
- package/dist/utils/md5.js +77 -79
- package/dist/utils/md5.js.map +1 -1
- package/dist/version/version.d.ts +1 -1
- package/dist/version/version.js +1 -1
- package/dist/version/version.js.map +1 -1
- package/package.json +7 -3
- package/dist/components-BZukhWDk.js +0 -106
- package/dist/components-BZukhWDk.js.map +0 -1
- package/dist/utils/vue/install.d.ts +0 -6
- package/dist/utils/vue/install.js +0 -21
- package/dist/utils/vue/install.js.map +0 -1
- package/dist/utils/vue/typescript.d.ts +0 -5
- package/dist/utils/vue/typescript.js +0 -2
- package/dist/utils/vue/typescript.js.map +0 -1
@@ -1,14 +1,18 @@
|
|
1
|
-
import {
|
2
|
-
import { defineComponent as
|
3
|
-
import {
|
4
|
-
import {
|
5
|
-
import {
|
6
|
-
|
1
|
+
import { isString as G, isDate as P } from "lodash-es";
|
2
|
+
import { defineComponent as y, mergeModels as j, useModel as I, useTemplateRef as $, provide as H, reactive as L, toRef as v, openBlock as m, createBlock as f, unref as e, withCtx as d, createVNode as h, renderSlot as M, computed as O, createElementBlock as C, Fragment as z, renderList as F, createTextVNode as N, toDisplayString as A, ref as K, onMounted as J, normalizeStyle as Q } from "vue";
|
3
|
+
import { withInstall as X } from "../_util/vue/install.js";
|
4
|
+
import { ElForm as Z, ElRow as x, ElCol as c, ElFormItem as w, ElInput as B, ElSelect as E, ElOption as U, ElRadioGroup as _, ElRadio as ee, ElCheckboxGroup as le, ElCheckbox as T, ElSwitch as ae, dayjs as R, ElTimePicker as oe, ElDatePicker as re } from "element-plus";
|
5
|
+
import { formContextKey as te } from "./Form.js";
|
6
|
+
import { useFormSpan as g, useFormRules as V, useFormContext as S, useFormDisabled as Y, useFormCode as W } from "./hooks/useForm.js";
|
7
|
+
import { getSingleCodeContent as ne, getMultiCodeContent as de } from "./utils/index.js";
|
8
|
+
import D from "../../error/OrionError.js";
|
9
|
+
import { S as ue } from "../../index-BbsXWo7C.js";
|
10
|
+
const ie = /* @__PURE__ */ y({
|
7
11
|
name: "OForm",
|
8
12
|
__name: "Form",
|
9
|
-
props: /* @__PURE__ */
|
13
|
+
props: /* @__PURE__ */ j({
|
10
14
|
rules: {},
|
11
|
-
itemSpan: { default:
|
15
|
+
itemSpan: { default: 6 },
|
12
16
|
itemLabelWidth: { default: "auto" },
|
13
17
|
disabled: { type: Boolean, default: !1 }
|
14
18
|
}, {
|
@@ -16,28 +20,32 @@ const M = /* @__PURE__ */ p({
|
|
16
20
|
modelModifiers: {}
|
17
21
|
}),
|
18
22
|
emits: ["update:modelValue"],
|
19
|
-
setup(o, { expose:
|
20
|
-
const
|
21
|
-
return
|
22
|
-
validate: async () => await
|
23
|
-
}),
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
23
|
+
setup(o, { expose: p }) {
|
24
|
+
const i = I(o, "modelValue"), t = $("formRef");
|
25
|
+
return p({
|
26
|
+
validate: async () => await t.value.validate()
|
27
|
+
}), H(
|
28
|
+
te,
|
29
|
+
L({
|
30
|
+
model: i.value,
|
31
|
+
rules: v(() => o.rules),
|
32
|
+
itemSpan: v(() => o.itemSpan),
|
33
|
+
disabled: v(() => o.disabled)
|
34
|
+
})
|
35
|
+
), (l, u) => (m(), f(e(Z), {
|
28
36
|
ref_key: "formRef",
|
29
|
-
ref:
|
30
|
-
modelValue:
|
31
|
-
"onUpdate:modelValue":
|
32
|
-
model:
|
33
|
-
rules:
|
34
|
-
"label-width":
|
35
|
-
disabled:
|
37
|
+
ref: t,
|
38
|
+
modelValue: i.value,
|
39
|
+
"onUpdate:modelValue": u[0] || (u[0] = (a) => i.value = a),
|
40
|
+
model: i.value,
|
41
|
+
rules: l.rules,
|
42
|
+
"label-width": l.itemLabelWidth,
|
43
|
+
disabled: l.disabled
|
36
44
|
}, {
|
37
|
-
default:
|
38
|
-
|
39
|
-
default:
|
40
|
-
|
45
|
+
default: d(() => [
|
46
|
+
h(e(x), { gutter: 16 }, {
|
47
|
+
default: d(() => [
|
48
|
+
M(l.$slots, "default")
|
41
49
|
]),
|
42
50
|
_: 3
|
43
51
|
})
|
@@ -45,8 +53,9 @@ const M = /* @__PURE__ */ p({
|
|
45
53
|
_: 3
|
46
54
|
}, 8, ["modelValue", "model", "rules", "label-width", "disabled"]));
|
47
55
|
}
|
48
|
-
}),
|
56
|
+
}), se = /* @__PURE__ */ y({
|
49
57
|
name: "OFormString",
|
58
|
+
extendOptions: { trigger: "blur" },
|
50
59
|
__name: "StringInput",
|
51
60
|
props: {
|
52
61
|
name: {},
|
@@ -58,30 +67,28 @@ const M = /* @__PURE__ */ p({
|
|
58
67
|
maxlength: {},
|
59
68
|
placeholder: {},
|
60
69
|
disabled: { type: Boolean },
|
61
|
-
readonly: { type: Boolean }
|
62
|
-
style: {}
|
70
|
+
readonly: { type: Boolean }
|
63
71
|
},
|
64
72
|
setup(o) {
|
65
|
-
const
|
66
|
-
return (
|
67
|
-
default:
|
68
|
-
|
69
|
-
prop:
|
70
|
-
label:
|
71
|
-
"label-width":
|
72
|
-
required:
|
73
|
-
rules:
|
73
|
+
const p = g(), i = V(), t = S(), r = v(t.model, o.name);
|
74
|
+
return (l, u) => (m(), f(e(c), { span: e(p) }, {
|
75
|
+
default: d(() => [
|
76
|
+
h(e(w), {
|
77
|
+
prop: l.name,
|
78
|
+
label: l.label,
|
79
|
+
"label-width": l.labelWidth,
|
80
|
+
required: l.required,
|
81
|
+
rules: e(i)
|
74
82
|
}, {
|
75
|
-
default:
|
76
|
-
|
77
|
-
modelValue:
|
78
|
-
"onUpdate:modelValue":
|
79
|
-
maxlength:
|
80
|
-
placeholder:
|
81
|
-
disabled:
|
82
|
-
readonly:
|
83
|
-
|
84
|
-
}, null, 8, ["modelValue", "maxlength", "placeholder", "disabled", "readonly", "input-style"])
|
83
|
+
default: d(() => [
|
84
|
+
h(e(B), {
|
85
|
+
modelValue: r.value,
|
86
|
+
"onUpdate:modelValue": u[0] || (u[0] = (a) => r.value = a),
|
87
|
+
maxlength: l.maxlength,
|
88
|
+
placeholder: l.placeholder,
|
89
|
+
disabled: l.disabled,
|
90
|
+
readonly: l.readonly
|
91
|
+
}, null, 8, ["modelValue", "maxlength", "placeholder", "disabled", "readonly"])
|
85
92
|
]),
|
86
93
|
_: 1
|
87
94
|
}, 8, ["prop", "label", "label-width", "required", "rules"])
|
@@ -89,8 +96,9 @@ const M = /* @__PURE__ */ p({
|
|
89
96
|
_: 1
|
90
97
|
}, 8, ["span"]));
|
91
98
|
}
|
92
|
-
}),
|
99
|
+
}), me = /* @__PURE__ */ y({
|
93
100
|
name: "OFormPassword",
|
101
|
+
extendOptions: { trigger: "blur" },
|
94
102
|
__name: "PasswordInput",
|
95
103
|
props: {
|
96
104
|
name: {},
|
@@ -102,31 +110,29 @@ const M = /* @__PURE__ */ p({
|
|
102
110
|
maxlength: {},
|
103
111
|
placeholder: {},
|
104
112
|
disabled: { type: Boolean },
|
105
|
-
readonly: { type: Boolean }
|
106
|
-
style: {}
|
113
|
+
readonly: { type: Boolean }
|
107
114
|
},
|
108
115
|
setup(o) {
|
109
|
-
const
|
110
|
-
return (
|
111
|
-
default:
|
112
|
-
|
113
|
-
prop:
|
114
|
-
label:
|
115
|
-
"label-width":
|
116
|
-
required:
|
117
|
-
rules:
|
116
|
+
const p = g(), i = V(), t = S(), r = v(t.model, o.name);
|
117
|
+
return (l, u) => (m(), f(e(c), { span: e(p) }, {
|
118
|
+
default: d(() => [
|
119
|
+
h(e(w), {
|
120
|
+
prop: l.name,
|
121
|
+
label: l.label,
|
122
|
+
"label-width": l.labelWidth,
|
123
|
+
required: l.required,
|
124
|
+
rules: e(i)
|
118
125
|
}, {
|
119
|
-
default:
|
120
|
-
|
121
|
-
modelValue:
|
122
|
-
"onUpdate:modelValue":
|
123
|
-
maxlength:
|
124
|
-
placeholder:
|
125
|
-
disabled:
|
126
|
-
readonly:
|
127
|
-
"input-style": e.style,
|
126
|
+
default: d(() => [
|
127
|
+
h(e(B), {
|
128
|
+
modelValue: r.value,
|
129
|
+
"onUpdate:modelValue": u[0] || (u[0] = (a) => r.value = a),
|
130
|
+
maxlength: l.maxlength,
|
131
|
+
placeholder: l.placeholder,
|
132
|
+
disabled: l.disabled,
|
133
|
+
readonly: l.readonly,
|
128
134
|
type: "password"
|
129
|
-
}, null, 8, ["modelValue", "maxlength", "placeholder", "disabled", "readonly"
|
135
|
+
}, null, 8, ["modelValue", "maxlength", "placeholder", "disabled", "readonly"])
|
130
136
|
]),
|
131
137
|
_: 1
|
132
138
|
}, 8, ["prop", "label", "label-width", "required", "rules"])
|
@@ -134,8 +140,9 @@ const M = /* @__PURE__ */ p({
|
|
134
140
|
_: 1
|
135
141
|
}, 8, ["span"]));
|
136
142
|
}
|
137
|
-
}),
|
143
|
+
}), pe = /* @__PURE__ */ y({
|
138
144
|
name: "OFormTextarea",
|
145
|
+
extendOptions: { trigger: "blur" },
|
139
146
|
__name: "Textarea",
|
140
147
|
props: {
|
141
148
|
name: {},
|
@@ -148,33 +155,202 @@ const M = /* @__PURE__ */ p({
|
|
148
155
|
placeholder: {},
|
149
156
|
disabled: { type: Boolean },
|
150
157
|
readonly: { type: Boolean },
|
151
|
-
style: {},
|
152
158
|
rows: {}
|
153
159
|
},
|
154
160
|
setup(o) {
|
155
|
-
const
|
156
|
-
return (
|
157
|
-
default:
|
158
|
-
|
159
|
-
prop:
|
160
|
-
label:
|
161
|
-
"label-width":
|
162
|
-
required:
|
163
|
-
rules:
|
161
|
+
const p = g(), i = V(), t = S(), r = v(t.model, o.name);
|
162
|
+
return (l, u) => (m(), f(e(c), { span: e(p) }, {
|
163
|
+
default: d(() => [
|
164
|
+
h(e(w), {
|
165
|
+
prop: l.name,
|
166
|
+
label: l.label,
|
167
|
+
"label-width": l.labelWidth,
|
168
|
+
required: l.required,
|
169
|
+
rules: e(i)
|
164
170
|
}, {
|
165
|
-
default:
|
166
|
-
|
167
|
-
modelValue:
|
168
|
-
"onUpdate:modelValue":
|
169
|
-
maxlength:
|
170
|
-
placeholder:
|
171
|
-
disabled:
|
172
|
-
readonly:
|
173
|
-
"input-style": e.style,
|
171
|
+
default: d(() => [
|
172
|
+
h(e(B), {
|
173
|
+
modelValue: r.value,
|
174
|
+
"onUpdate:modelValue": u[0] || (u[0] = (a) => r.value = a),
|
175
|
+
maxlength: l.maxlength,
|
176
|
+
placeholder: l.placeholder,
|
177
|
+
disabled: l.disabled,
|
178
|
+
readonly: l.readonly,
|
174
179
|
type: "textarea",
|
175
|
-
rows:
|
180
|
+
rows: l.rows,
|
176
181
|
resize: "none"
|
177
|
-
}, null, 8, ["modelValue", "maxlength", "placeholder", "disabled", "readonly", "
|
182
|
+
}, null, 8, ["modelValue", "maxlength", "placeholder", "disabled", "readonly", "rows"])
|
183
|
+
]),
|
184
|
+
_: 1
|
185
|
+
}, 8, ["prop", "label", "label-width", "required", "rules"])
|
186
|
+
]),
|
187
|
+
_: 1
|
188
|
+
}, 8, ["span"]));
|
189
|
+
}
|
190
|
+
}), be = /* @__PURE__ */ y({
|
191
|
+
name: "OFormSingleselect",
|
192
|
+
extendOptions: {},
|
193
|
+
__name: "SingleSelect",
|
194
|
+
props: {
|
195
|
+
name: {},
|
196
|
+
label: {},
|
197
|
+
span: {},
|
198
|
+
labelWidth: {},
|
199
|
+
required: { type: Boolean },
|
200
|
+
rules: {},
|
201
|
+
placeholder: {},
|
202
|
+
disabled: { type: Boolean },
|
203
|
+
code: {},
|
204
|
+
clearable: { type: Boolean },
|
205
|
+
filterable: { type: Boolean }
|
206
|
+
},
|
207
|
+
setup(o) {
|
208
|
+
const p = g(), i = V(), t = Y(), r = W(), l = O(() => ne(r.value, a.value)), u = S(), a = v(u.model, o.name);
|
209
|
+
return (s, b) => (m(), f(e(c), { span: e(p) }, {
|
210
|
+
default: d(() => [
|
211
|
+
h(e(w), {
|
212
|
+
prop: s.name,
|
213
|
+
label: s.label,
|
214
|
+
"label-width": s.labelWidth,
|
215
|
+
required: s.required,
|
216
|
+
rules: e(i)
|
217
|
+
}, {
|
218
|
+
default: d(() => [
|
219
|
+
e(t) ? (m(), f(e(B), {
|
220
|
+
key: 0,
|
221
|
+
"model-value": l.value,
|
222
|
+
placeholder: s.placeholder,
|
223
|
+
disabled: !0,
|
224
|
+
readonly: !0
|
225
|
+
}, null, 8, ["model-value", "placeholder"])) : (m(), f(e(E), {
|
226
|
+
key: 1,
|
227
|
+
modelValue: a.value,
|
228
|
+
"onUpdate:modelValue": b[0] || (b[0] = (n) => a.value = n),
|
229
|
+
placeholder: s.placeholder,
|
230
|
+
clearable: s.clearable,
|
231
|
+
filterable: s.filterable
|
232
|
+
}, {
|
233
|
+
default: d(() => [
|
234
|
+
(m(!0), C(z, null, F(e(r), (n) => (m(), f(e(U), {
|
235
|
+
key: n.value,
|
236
|
+
label: n.content,
|
237
|
+
value: n.value
|
238
|
+
}, null, 8, ["label", "value"]))), 128))
|
239
|
+
]),
|
240
|
+
_: 1
|
241
|
+
}, 8, ["modelValue", "placeholder", "clearable", "filterable"]))
|
242
|
+
]),
|
243
|
+
_: 1
|
244
|
+
}, 8, ["prop", "label", "label-width", "required", "rules"])
|
245
|
+
]),
|
246
|
+
_: 1
|
247
|
+
}, 8, ["span"]));
|
248
|
+
}
|
249
|
+
}), fe = /* @__PURE__ */ y({
|
250
|
+
name: "OFormMultiselect",
|
251
|
+
extendOptions: {},
|
252
|
+
__name: "MultiSelect",
|
253
|
+
props: {
|
254
|
+
name: {},
|
255
|
+
label: {},
|
256
|
+
span: {},
|
257
|
+
labelWidth: {},
|
258
|
+
required: { type: Boolean },
|
259
|
+
rules: {},
|
260
|
+
placeholder: {},
|
261
|
+
disabled: { type: Boolean },
|
262
|
+
code: {}
|
263
|
+
},
|
264
|
+
setup(o) {
|
265
|
+
const p = g(), i = V(), t = Y(), r = W(), l = O(() => de(r.value, a.value)), u = S(), a = v(u.model, o.name), s = O({
|
266
|
+
get: () => a.value ? a.value.split(",") : [],
|
267
|
+
set: (b) => {
|
268
|
+
b ? a.value = b.join(",") : a.value = "";
|
269
|
+
}
|
270
|
+
});
|
271
|
+
return (b, n) => (m(), f(e(c), { span: e(p) }, {
|
272
|
+
default: d(() => [
|
273
|
+
h(e(w), {
|
274
|
+
prop: b.name,
|
275
|
+
label: b.label,
|
276
|
+
"label-width": b.labelWidth,
|
277
|
+
required: b.required,
|
278
|
+
rules: e(i)
|
279
|
+
}, {
|
280
|
+
default: d(() => [
|
281
|
+
e(t) ? (m(), f(e(B), {
|
282
|
+
key: 0,
|
283
|
+
"model-value": l.value,
|
284
|
+
placeholder: b.placeholder,
|
285
|
+
disabled: !0,
|
286
|
+
readonly: !0
|
287
|
+
}, null, 8, ["model-value", "placeholder"])) : (m(), f(e(E), {
|
288
|
+
key: 1,
|
289
|
+
modelValue: s.value,
|
290
|
+
"onUpdate:modelValue": n[0] || (n[0] = (q) => s.value = q),
|
291
|
+
placeholder: b.placeholder,
|
292
|
+
multiple: ""
|
293
|
+
}, {
|
294
|
+
default: d(() => [
|
295
|
+
(m(!0), C(z, null, F(e(r), (q) => (m(), f(e(U), {
|
296
|
+
key: q.value,
|
297
|
+
label: q.content,
|
298
|
+
value: q.value
|
299
|
+
}, null, 8, ["label", "value"]))), 128))
|
300
|
+
]),
|
301
|
+
_: 1
|
302
|
+
}, 8, ["modelValue", "placeholder"]))
|
303
|
+
]),
|
304
|
+
_: 1
|
305
|
+
}, 8, ["prop", "label", "label-width", "required", "rules"])
|
306
|
+
]),
|
307
|
+
_: 1
|
308
|
+
}, 8, ["span"]));
|
309
|
+
}
|
310
|
+
}), he = /* @__PURE__ */ y({
|
311
|
+
name: "OFormRadiogroup",
|
312
|
+
extendOptions: {},
|
313
|
+
__name: "RadioGroup",
|
314
|
+
props: {
|
315
|
+
name: {},
|
316
|
+
label: {},
|
317
|
+
span: {},
|
318
|
+
labelWidth: {},
|
319
|
+
required: { type: Boolean },
|
320
|
+
rules: {},
|
321
|
+
disabled: { type: Boolean },
|
322
|
+
code: {}
|
323
|
+
},
|
324
|
+
setup(o) {
|
325
|
+
const p = g(), i = V(), t = W(), r = S(), l = v(r.model, o.name);
|
326
|
+
return (u, a) => (m(), f(e(c), { span: e(p) }, {
|
327
|
+
default: d(() => [
|
328
|
+
h(e(w), {
|
329
|
+
prop: u.name,
|
330
|
+
label: u.label,
|
331
|
+
"label-width": u.labelWidth,
|
332
|
+
required: u.required,
|
333
|
+
rules: e(i)
|
334
|
+
}, {
|
335
|
+
default: d(() => [
|
336
|
+
h(e(_), {
|
337
|
+
modelValue: l.value,
|
338
|
+
"onUpdate:modelValue": a[0] || (a[0] = (s) => l.value = s),
|
339
|
+
disabled: u.disabled
|
340
|
+
}, {
|
341
|
+
default: d(() => [
|
342
|
+
(m(!0), C(z, null, F(e(t), (s) => (m(), f(e(ee), {
|
343
|
+
key: s.value,
|
344
|
+
value: s.value
|
345
|
+
}, {
|
346
|
+
default: d(() => [
|
347
|
+
N(A(s.content), 1)
|
348
|
+
]),
|
349
|
+
_: 2
|
350
|
+
}, 1032, ["value"]))), 128))
|
351
|
+
]),
|
352
|
+
_: 1
|
353
|
+
}, 8, ["modelValue", "disabled"])
|
178
354
|
]),
|
179
355
|
_: 1
|
180
356
|
}, 8, ["prop", "label", "label-width", "required", "rules"])
|
@@ -182,13 +358,349 @@ const M = /* @__PURE__ */ p({
|
|
182
358
|
_: 1
|
183
359
|
}, 8, ["span"]));
|
184
360
|
}
|
185
|
-
}),
|
186
|
-
|
187
|
-
|
188
|
-
|
361
|
+
}), ve = /* @__PURE__ */ y({
|
362
|
+
name: "OFormCheckboxgroup",
|
363
|
+
extendOptions: {},
|
364
|
+
__name: "CheckboxGroup",
|
365
|
+
props: {
|
366
|
+
name: {},
|
367
|
+
label: {},
|
368
|
+
span: {},
|
369
|
+
labelWidth: {},
|
370
|
+
required: { type: Boolean },
|
371
|
+
rules: {},
|
372
|
+
disabled: { type: Boolean },
|
373
|
+
code: {}
|
374
|
+
},
|
375
|
+
setup(o) {
|
376
|
+
const p = g(), i = V(), t = W(), r = S(), l = v(r.model, o.name), u = O({
|
377
|
+
get: () => l.value ? l.value.split(",") : [],
|
378
|
+
set: (a) => {
|
379
|
+
a ? l.value = a.join(",") : l.value = "";
|
380
|
+
}
|
381
|
+
});
|
382
|
+
return (a, s) => (m(), f(e(c), { span: e(p) }, {
|
383
|
+
default: d(() => [
|
384
|
+
h(e(w), {
|
385
|
+
prop: a.name,
|
386
|
+
label: a.label,
|
387
|
+
"label-width": a.labelWidth,
|
388
|
+
required: a.required,
|
389
|
+
rules: e(i)
|
390
|
+
}, {
|
391
|
+
default: d(() => [
|
392
|
+
h(e(le), {
|
393
|
+
modelValue: u.value,
|
394
|
+
"onUpdate:modelValue": s[0] || (s[0] = (b) => u.value = b),
|
395
|
+
disabled: a.disabled
|
396
|
+
}, {
|
397
|
+
default: d(() => [
|
398
|
+
(m(!0), C(z, null, F(e(t), (b) => (m(), f(e(T), {
|
399
|
+
key: b.value,
|
400
|
+
label: b.content,
|
401
|
+
value: b.value
|
402
|
+
}, null, 8, ["label", "value"]))), 128))
|
403
|
+
]),
|
404
|
+
_: 1
|
405
|
+
}, 8, ["modelValue", "disabled"])
|
406
|
+
]),
|
407
|
+
_: 1
|
408
|
+
}, 8, ["prop", "label", "label-width", "required", "rules"])
|
409
|
+
]),
|
410
|
+
_: 1
|
411
|
+
}, 8, ["span"]));
|
412
|
+
}
|
413
|
+
}), ye = /* @__PURE__ */ y({
|
414
|
+
name: "OFormCheckbox",
|
415
|
+
extendOptions: {},
|
416
|
+
__name: "Checkbox",
|
417
|
+
props: {
|
418
|
+
name: {},
|
419
|
+
label: {},
|
420
|
+
span: {},
|
421
|
+
labelWidth: {},
|
422
|
+
rules: {},
|
423
|
+
disabled: { type: Boolean }
|
424
|
+
},
|
425
|
+
setup(o) {
|
426
|
+
const p = g(), i = S(), t = v(i.model, o.name);
|
427
|
+
return (r, l) => (m(), f(e(c), { span: e(p) }, {
|
428
|
+
default: d(() => [
|
429
|
+
h(e(w), {
|
430
|
+
prop: r.name,
|
431
|
+
label: r.label,
|
432
|
+
"label-width": r.labelWidth,
|
433
|
+
rules: r.rules
|
434
|
+
}, {
|
435
|
+
default: d(() => [
|
436
|
+
h(e(T), {
|
437
|
+
modelValue: t.value,
|
438
|
+
"onUpdate:modelValue": l[0] || (l[0] = (u) => t.value = u),
|
439
|
+
disabled: r.disabled,
|
440
|
+
"true-value": "1",
|
441
|
+
"false-value": "0"
|
442
|
+
}, null, 8, ["modelValue", "disabled"])
|
443
|
+
]),
|
444
|
+
_: 1
|
445
|
+
}, 8, ["prop", "label", "label-width", "rules"])
|
446
|
+
]),
|
447
|
+
_: 1
|
448
|
+
}, 8, ["span"]));
|
449
|
+
}
|
450
|
+
}), ce = /* @__PURE__ */ y({
|
451
|
+
name: "OFormSwitch",
|
452
|
+
extendOptions: {},
|
453
|
+
__name: "Switch",
|
454
|
+
props: {
|
455
|
+
name: {},
|
456
|
+
label: {},
|
457
|
+
span: {},
|
458
|
+
labelWidth: {},
|
459
|
+
rules: {},
|
460
|
+
disabled: { type: Boolean }
|
461
|
+
},
|
462
|
+
setup(o) {
|
463
|
+
const p = g(), i = S(), t = v(i.model, o.name);
|
464
|
+
return (r, l) => (m(), f(e(c), { span: e(p) }, {
|
465
|
+
default: d(() => [
|
466
|
+
h(e(w), {
|
467
|
+
prop: r.name,
|
468
|
+
label: r.label,
|
469
|
+
"label-width": r.labelWidth,
|
470
|
+
rules: r.rules
|
471
|
+
}, {
|
472
|
+
default: d(() => [
|
473
|
+
h(e(ae), {
|
474
|
+
modelValue: t.value,
|
475
|
+
"onUpdate:modelValue": l[0] || (l[0] = (u) => t.value = u),
|
476
|
+
disabled: r.disabled,
|
477
|
+
"active-value": "1",
|
478
|
+
"inactive-value": "0"
|
479
|
+
}, null, 8, ["modelValue", "disabled"])
|
480
|
+
]),
|
481
|
+
_: 1
|
482
|
+
}, 8, ["prop", "label", "label-width", "rules"])
|
483
|
+
]),
|
484
|
+
_: 1
|
485
|
+
}, 8, ["span"]));
|
486
|
+
}
|
487
|
+
}), ge = /* @__PURE__ */ y({
|
488
|
+
name: "OFormDate",
|
489
|
+
extendOptions: { trigger: "blur" },
|
490
|
+
__name: "DateInput",
|
491
|
+
props: {
|
492
|
+
name: {},
|
493
|
+
label: {},
|
494
|
+
span: {},
|
495
|
+
labelWidth: {},
|
496
|
+
required: { type: Boolean },
|
497
|
+
rules: {},
|
498
|
+
maxlength: {},
|
499
|
+
placeholder: {},
|
500
|
+
disabled: { type: Boolean },
|
501
|
+
readonly: { type: Boolean },
|
502
|
+
editable: { type: Boolean },
|
503
|
+
clearable: { type: Boolean },
|
504
|
+
format: { default: "YYYY-MM-DD" },
|
505
|
+
sourceFormat: {}
|
506
|
+
},
|
507
|
+
setup(o) {
|
508
|
+
const p = g(), i = V(), t = O(
|
509
|
+
() => o.format.startsWith("H") || o.format.startsWith("h") || o.format.startsWith("m") || o.format.startsWith("s")
|
510
|
+
), r = O(() => o.sourceFormat ? o.sourceFormat : t.value ? "HH:mm:ss" : "YYYY-MM-DD"), l = O(() => {
|
511
|
+
let n = "date";
|
512
|
+
return (o.format.indexOf("y") > -1 || o.format.indexOf("Y") > -1) && (n = "year"), o.format.indexOf("M") > -1 && (n = "month"), (o.format.indexOf("d") > -1 || o.format.indexOf("D") > -1) && (n = "date"), (o.format.indexOf("H") > -1 || o.format.indexOf("h") > -1 || o.format.indexOf("k") > -1 || o.format.indexOf("m") > -1 || o.format.indexOf("s") > -1 || o.format.indexOf("S") > -1) && (n = "datetime"), n;
|
513
|
+
}), u = S(), a = v(u.model, o.name), s = O(() => {
|
514
|
+
if (G(a.value))
|
515
|
+
return "string";
|
516
|
+
if (P(a.value))
|
517
|
+
return "date";
|
518
|
+
throw new D("日期输入框的值只能为字符串或日期类型");
|
519
|
+
}), b = O({
|
520
|
+
get: () => {
|
521
|
+
if (a.value) {
|
522
|
+
if (s.value == "date")
|
523
|
+
return a.value;
|
524
|
+
{
|
525
|
+
const n = R(a.value, r.value, !0);
|
526
|
+
if (!n.isValid())
|
527
|
+
throw new D(`日期输入框的值无效,不符合${r.value}格式`);
|
528
|
+
return n.toDate();
|
529
|
+
}
|
530
|
+
}
|
531
|
+
},
|
532
|
+
set: (n) => {
|
533
|
+
s.value == "date" ? n ? a.value = n : a.value = void 0 : n ? a.value = R(n).format(r.value) : a.value = "";
|
534
|
+
}
|
535
|
+
});
|
536
|
+
return (n, q) => (m(), f(e(c), { span: e(p) }, {
|
537
|
+
default: d(() => [
|
538
|
+
h(e(w), {
|
539
|
+
prop: n.name,
|
540
|
+
label: n.label,
|
541
|
+
"label-width": n.labelWidth,
|
542
|
+
required: n.required,
|
543
|
+
rules: e(i)
|
544
|
+
}, {
|
545
|
+
default: d(() => [
|
546
|
+
t.value ? (m(), f(e(oe), {
|
547
|
+
key: 0,
|
548
|
+
modelValue: b.value,
|
549
|
+
"onUpdate:modelValue": q[0] || (q[0] = (k) => b.value = k),
|
550
|
+
placeholder: n.placeholder,
|
551
|
+
disabled: n.disabled,
|
552
|
+
readonly: n.readonly,
|
553
|
+
editable: n.editable,
|
554
|
+
clearable: n.clearable,
|
555
|
+
format: r.value,
|
556
|
+
"arrow-control": "",
|
557
|
+
style: { width: "100%" }
|
558
|
+
}, null, 8, ["modelValue", "placeholder", "disabled", "readonly", "editable", "clearable", "format"])) : (m(), f(e(re), {
|
559
|
+
key: 1,
|
560
|
+
modelValue: b.value,
|
561
|
+
"onUpdate:modelValue": q[1] || (q[1] = (k) => b.value = k),
|
562
|
+
placeholder: n.placeholder,
|
563
|
+
disabled: n.disabled,
|
564
|
+
readonly: n.readonly,
|
565
|
+
editable: n.editable,
|
566
|
+
clearable: n.clearable,
|
567
|
+
type: l.value,
|
568
|
+
format: r.value,
|
569
|
+
style: { width: "100%" }
|
570
|
+
}, null, 8, ["modelValue", "placeholder", "disabled", "readonly", "editable", "clearable", "type", "format"]))
|
571
|
+
]),
|
572
|
+
_: 1
|
573
|
+
}, 8, ["prop", "label", "label-width", "required", "rules"])
|
574
|
+
]),
|
575
|
+
_: 1
|
576
|
+
}, 8, ["span"]));
|
577
|
+
}
|
578
|
+
}), we = /* @__PURE__ */ y({
|
579
|
+
name: "OFormFile",
|
580
|
+
extendOptions: {},
|
581
|
+
__name: "FileInput",
|
582
|
+
props: {
|
583
|
+
name: {},
|
584
|
+
label: {},
|
585
|
+
span: {},
|
586
|
+
labelWidth: {},
|
587
|
+
required: { type: Boolean },
|
588
|
+
rules: {},
|
589
|
+
disabled: { type: Boolean }
|
590
|
+
},
|
591
|
+
setup(o) {
|
592
|
+
const p = g(), i = V(), t = K(""), r = $("fileRef");
|
593
|
+
J(() => {
|
594
|
+
r.value.input.onchange = (a) => {
|
595
|
+
var s;
|
596
|
+
u.value = (s = a == null ? void 0 : a.target) == null ? void 0 : s.files[0];
|
597
|
+
};
|
598
|
+
});
|
599
|
+
const l = S(), u = v(l.model, o.name);
|
600
|
+
return (a, s) => (m(), f(e(c), { span: e(p) }, {
|
601
|
+
default: d(() => [
|
602
|
+
h(e(w), {
|
603
|
+
prop: a.name,
|
604
|
+
label: a.label,
|
605
|
+
"label-width": a.labelWidth,
|
606
|
+
required: a.required,
|
607
|
+
rules: e(i)
|
608
|
+
}, {
|
609
|
+
default: d(() => [
|
610
|
+
h(e(B), {
|
611
|
+
ref_key: "fileRef",
|
612
|
+
ref: r,
|
613
|
+
modelValue: t.value,
|
614
|
+
"onUpdate:modelValue": s[0] || (s[0] = (b) => t.value = b),
|
615
|
+
disabled: a.disabled,
|
616
|
+
type: "file"
|
617
|
+
}, null, 8, ["modelValue", "disabled"])
|
618
|
+
]),
|
619
|
+
_: 1
|
620
|
+
}, 8, ["prop", "label", "label-width", "required", "rules"])
|
621
|
+
]),
|
622
|
+
_: 1
|
623
|
+
}, 8, ["span"]));
|
624
|
+
}
|
625
|
+
}), Se = /* @__PURE__ */ y({
|
626
|
+
name: "OFormButtongroup",
|
627
|
+
__name: "ButtonGroup",
|
628
|
+
props: {
|
629
|
+
span: {},
|
630
|
+
gutter: { type: [Boolean, String] },
|
631
|
+
align: { default: "right" }
|
632
|
+
},
|
633
|
+
setup(o) {
|
634
|
+
const p = O(() => ({
|
635
|
+
textAlign: o.align
|
636
|
+
})), i = g();
|
637
|
+
return (t, r) => (m(), f(e(c), {
|
638
|
+
span: e(i),
|
639
|
+
style: Q(p.value)
|
640
|
+
}, {
|
641
|
+
default: d(() => [
|
642
|
+
h(e(ue), {
|
643
|
+
gutter: t.gutter,
|
644
|
+
style: { "margin-bottom": "18px" }
|
645
|
+
}, {
|
646
|
+
default: d(() => [
|
647
|
+
M(t.$slots, "default")
|
648
|
+
]),
|
649
|
+
_: 3
|
650
|
+
}, 8, ["gutter"])
|
651
|
+
]),
|
652
|
+
_: 3
|
653
|
+
}, 8, ["span", "style"]));
|
654
|
+
}
|
655
|
+
}), qe = /* @__PURE__ */ y({
|
656
|
+
name: "OFormDiy",
|
657
|
+
extendOptions: {},
|
658
|
+
__name: "DiyItem",
|
659
|
+
props: {
|
660
|
+
name: {},
|
661
|
+
label: {},
|
662
|
+
span: {},
|
663
|
+
labelWidth: {},
|
664
|
+
required: { type: Boolean },
|
665
|
+
rules: {}
|
666
|
+
},
|
667
|
+
setup(o) {
|
668
|
+
const p = g(), i = V();
|
669
|
+
return (t, r) => (m(), f(e(c), { span: e(p) }, {
|
670
|
+
default: d(() => [
|
671
|
+
h(e(w), {
|
672
|
+
prop: t.name,
|
673
|
+
label: t.label,
|
674
|
+
"label-width": t.labelWidth,
|
675
|
+
required: t.required,
|
676
|
+
rules: e(i)
|
677
|
+
}, {
|
678
|
+
default: d(() => [
|
679
|
+
M(t.$slots, "default")
|
680
|
+
]),
|
681
|
+
_: 3
|
682
|
+
}, 8, ["prop", "label", "label-width", "required", "rules"])
|
683
|
+
]),
|
684
|
+
_: 3
|
685
|
+
}, 8, ["span"]));
|
686
|
+
}
|
687
|
+
}), Re = X(ie, {
|
688
|
+
StringInput: se,
|
689
|
+
PasswordInput: me,
|
690
|
+
Textarea: pe,
|
691
|
+
SingleSelect: be,
|
692
|
+
MultiSelect: fe,
|
693
|
+
RadioGroup: he,
|
694
|
+
CheckboxGroup: ve,
|
695
|
+
Checkbox: ye,
|
696
|
+
Switch: ce,
|
697
|
+
DateInput: ge,
|
698
|
+
FileInput: we,
|
699
|
+
ButtonGroup: Se,
|
700
|
+
DiyItem: qe
|
189
701
|
});
|
190
702
|
export {
|
191
|
-
|
192
|
-
|
703
|
+
Re as default,
|
704
|
+
te as formContextKey
|
193
705
|
};
|
194
706
|
//# sourceMappingURL=index.js.map
|