jky-component-lib 0.0.49 → 0.0.53
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/es/code-mirror-editor/CodeMirrorEditor.test.d.ts +1 -0
- package/dist/es/code-mirror-editor/CodeMirrorEditor.vue.d.ts +25 -0
- package/dist/es/code-mirror-editor/CodeMirrorEditor.vue.js +178 -0
- package/dist/es/code-mirror-editor/CodeMirrorEditor.vue3.js +5 -0
- package/dist/es/code-mirror-editor/index.d.ts +4 -0
- package/dist/es/code-mirror-editor/index.js +8 -0
- package/dist/es/code-mirror-editor/style.css +44 -0
- package/dist/es/components.d.ts +1 -0
- package/dist/es/components.js +4 -1
- package/dist/es/form/FormItem.vue.js +245 -94
- package/dist/es/index.js +2 -0
- package/dist/es/node_modules/@element-plus/icons-vue/dist/index.js +84 -0
- package/dist/es/package.json.js +2 -2
- package/dist/es/page-header/PopoverMenu.vue.d.ts +1 -1
- package/dist/es/style.css +125 -4
- package/dist/es/styles.css +1 -1
- package/dist/lib/button/Button.vue.js +10 -10
- package/dist/lib/button-nav/ButtonNav.vue.js +4 -4
- package/dist/lib/code-mirror-editor/CodeMirrorEditor.test.d.ts +1 -0
- package/dist/lib/code-mirror-editor/CodeMirrorEditor.vue.d.ts +25 -0
- package/dist/lib/code-mirror-editor/CodeMirrorEditor.vue.js +178 -0
- package/dist/lib/code-mirror-editor/CodeMirrorEditor.vue3.js +5 -0
- package/dist/lib/code-mirror-editor/index.d.ts +4 -0
- package/dist/lib/code-mirror-editor/index.js +8 -0
- package/dist/lib/code-mirror-editor/style.css +44 -0
- package/dist/lib/components.d.ts +1 -0
- package/dist/lib/components.js +15 -12
- package/dist/lib/form/Form.vue.js +6 -6
- package/dist/lib/form/FormItem.vue.js +248 -97
- package/dist/lib/index.js +10 -8
- package/dist/lib/menu/Aside.vue.js +2 -2
- package/dist/lib/menu/Menu.vue.js +2 -2
- package/dist/lib/node_modules/@element-plus/icons-vue/dist/index.js +84 -0
- package/dist/lib/package.json.js +2 -2
- package/dist/lib/page-header/PageHeader.vue.js +2 -2
- package/dist/lib/page-header/PopoverMenu.vue.d.ts +1 -1
- package/dist/lib/page-header/PopoverMenu.vue.js +12 -12
- package/dist/lib/style.css +125 -4
- package/dist/lib/styles.css +1 -1
- package/dist/umd/index.js +626 -104
- package/dist/umd/styles.css +1 -1
- package/package.json +6 -1
|
@@ -43,15 +43,15 @@ const vue = require("vue");
|
|
|
43
43
|
const ElementPlus = require("element-plus");
|
|
44
44
|
const FormItem_vue_vue_type_script_setup_true_lang = require("./FormItem.vue.js");
|
|
45
45
|
;/* empty css */
|
|
46
|
-
const _hoisted_1
|
|
46
|
+
const _hoisted_1 = {
|
|
47
47
|
key: 0,
|
|
48
48
|
class: "jky-form__title mb-4 text-xl font-semibold"
|
|
49
49
|
};
|
|
50
|
-
const _hoisted_2
|
|
50
|
+
const _hoisted_2 = {
|
|
51
51
|
key: 1,
|
|
52
52
|
class: "jky-form__footer mt-6 flex justify-end gap-2"
|
|
53
53
|
};
|
|
54
|
-
const _sfc_main
|
|
54
|
+
const _sfc_main = /* @__PURE__ */ vue.defineComponent(__spreadProps(__spreadValues({}, {
|
|
55
55
|
name: "JkyForm"
|
|
56
56
|
}), {
|
|
57
57
|
__name: "Form",
|
|
@@ -169,7 +169,7 @@ const _sfc_main$5 = /* @__PURE__ */ vue.defineComponent(__spreadProps(__spreadVa
|
|
|
169
169
|
return vue.openBlock(), vue.createElementBlock("div", {
|
|
170
170
|
class: vue.normalizeClass(formClass.value)
|
|
171
171
|
}, [
|
|
172
|
-
__props.showTitle && __props.title ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_1
|
|
172
|
+
__props.showTitle && __props.title ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_1, vue.toDisplayString(__props.title), 1)) : vue.createCommentVNode("", true),
|
|
173
173
|
vue.createVNode(vue.unref(ElementPlus.ElForm), vue.mergeProps({
|
|
174
174
|
ref_key: "formRef",
|
|
175
175
|
ref: formRef,
|
|
@@ -192,7 +192,7 @@ const _sfc_main$5 = /* @__PURE__ */ vue.defineComponent(__spreadProps(__spreadVa
|
|
|
192
192
|
]),
|
|
193
193
|
_: 1
|
|
194
194
|
}, 16, ["model", "label-width", "label-position", "size"]),
|
|
195
|
-
props.showFooter ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_2
|
|
195
|
+
props.showFooter ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_2, [
|
|
196
196
|
vue.createVNode(vue.unref(ElementPlus.ElButton), {
|
|
197
197
|
disabled: __props.cancelDisabled || __props.disabled,
|
|
198
198
|
onClick: handleCancel
|
|
@@ -218,4 +218,4 @@ const _sfc_main$5 = /* @__PURE__ */ vue.defineComponent(__spreadProps(__spreadVa
|
|
|
218
218
|
};
|
|
219
219
|
}
|
|
220
220
|
}));
|
|
221
|
-
exports.default = _sfc_main
|
|
221
|
+
exports.default = _sfc_main;
|
|
@@ -30,27 +30,49 @@ var __objRest = (source, exclude) => {
|
|
|
30
30
|
}
|
|
31
31
|
return target;
|
|
32
32
|
};
|
|
33
|
+
var __async = (__this, __arguments, generator) => {
|
|
34
|
+
return new Promise((resolve, reject) => {
|
|
35
|
+
var fulfilled = (value) => {
|
|
36
|
+
try {
|
|
37
|
+
step(generator.next(value));
|
|
38
|
+
} catch (e) {
|
|
39
|
+
reject(e);
|
|
40
|
+
}
|
|
41
|
+
};
|
|
42
|
+
var rejected = (value) => {
|
|
43
|
+
try {
|
|
44
|
+
step(generator.throw(value));
|
|
45
|
+
} catch (e) {
|
|
46
|
+
reject(e);
|
|
47
|
+
}
|
|
48
|
+
};
|
|
49
|
+
var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
|
|
50
|
+
step((generator = generator.apply(__this, __arguments)).next());
|
|
51
|
+
});
|
|
52
|
+
};
|
|
33
53
|
Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: "Module" } });
|
|
34
54
|
const vue = require("vue");
|
|
55
|
+
const index = require("../node_modules/@element-plus/icons-vue/dist/index.js");
|
|
35
56
|
const ElementPlus = require("element-plus");
|
|
36
|
-
const _hoisted_1
|
|
57
|
+
const _hoisted_1 = {
|
|
37
58
|
key: 0,
|
|
38
59
|
style: { "display": "none" }
|
|
39
60
|
};
|
|
40
|
-
const _hoisted_2
|
|
41
|
-
const _hoisted_3
|
|
61
|
+
const _hoisted_2 = { class: "jky-form-item__title text-base font-medium flex items-center" };
|
|
62
|
+
const _hoisted_3 = { class: "flex items-center" };
|
|
63
|
+
const _hoisted_4 = {
|
|
42
64
|
key: 0,
|
|
43
65
|
class: "flex items-center"
|
|
44
66
|
};
|
|
45
|
-
const
|
|
67
|
+
const _hoisted_5 = {
|
|
46
68
|
key: 0,
|
|
47
69
|
class: "mr-2"
|
|
48
70
|
};
|
|
49
|
-
const
|
|
71
|
+
const _hoisted_6 = {
|
|
50
72
|
key: 1,
|
|
51
73
|
class: "ml-2"
|
|
52
74
|
};
|
|
53
|
-
const _sfc_main
|
|
75
|
+
const _sfc_main = /* @__PURE__ */ vue.defineComponent(__spreadProps(__spreadValues({}, {
|
|
54
76
|
name: "JkyFormItem",
|
|
55
77
|
inheritAttrs: false
|
|
56
78
|
}), {
|
|
@@ -76,20 +98,43 @@ const _sfc_main$6 = /* @__PURE__ */ vue.defineComponent(__spreadProps(__spreadVa
|
|
|
76
98
|
},
|
|
77
99
|
setup(__props) {
|
|
78
100
|
const props = __props;
|
|
79
|
-
const
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
101
|
+
const loading = vue.ref(false);
|
|
102
|
+
const componentProps = vue.ref({});
|
|
103
|
+
function loadComponentProps() {
|
|
104
|
+
return __async(this, null, function* () {
|
|
105
|
+
const configProps = props.config.componentProps;
|
|
106
|
+
if (!configProps) {
|
|
107
|
+
componentProps.value = {};
|
|
108
|
+
return;
|
|
109
|
+
}
|
|
110
|
+
if (typeof configProps === "function") {
|
|
111
|
+
loading.value = true;
|
|
112
|
+
try {
|
|
113
|
+
const result = yield configProps({
|
|
114
|
+
model: props.model,
|
|
115
|
+
field: props.field,
|
|
116
|
+
$form: props.model
|
|
117
|
+
});
|
|
118
|
+
componentProps.value = result || {};
|
|
119
|
+
} catch (error) {
|
|
120
|
+
console.error("Failed to load component props:", error);
|
|
121
|
+
componentProps.value = {};
|
|
122
|
+
} finally {
|
|
123
|
+
loading.value = false;
|
|
124
|
+
}
|
|
125
|
+
return;
|
|
126
|
+
}
|
|
127
|
+
componentProps.value = configProps;
|
|
128
|
+
});
|
|
129
|
+
}
|
|
130
|
+
vue.watch(
|
|
131
|
+
() => props.model,
|
|
132
|
+
() => {
|
|
133
|
+
loadComponentProps();
|
|
134
|
+
},
|
|
135
|
+
{ deep: true }
|
|
136
|
+
);
|
|
137
|
+
loadComponentProps();
|
|
93
138
|
const modelValue = vue.computed({
|
|
94
139
|
get: () => props.model[props.field],
|
|
95
140
|
set: (val) => {
|
|
@@ -158,7 +203,13 @@ const _sfc_main$6 = /* @__PURE__ */ vue.defineComponent(__spreadProps(__spreadVa
|
|
|
158
203
|
return rest;
|
|
159
204
|
});
|
|
160
205
|
function renderComponent(type) {
|
|
161
|
-
var _a, _b
|
|
206
|
+
var _a, _b;
|
|
207
|
+
if (type === "divider") {
|
|
208
|
+
const dividerProps = __spreadValues({}, componentProps.value);
|
|
209
|
+
return vue.h(ElementPlus.ElDivider, dividerProps, {
|
|
210
|
+
default: () => props.config.children || null
|
|
211
|
+
});
|
|
212
|
+
}
|
|
162
213
|
const commonProps = __spreadValues({
|
|
163
214
|
"modelValue": modelValue.value,
|
|
164
215
|
"onUpdate:modelValue": (val) => {
|
|
@@ -166,11 +217,8 @@ const _sfc_main$6 = /* @__PURE__ */ vue.defineComponent(__spreadProps(__spreadVa
|
|
|
166
217
|
},
|
|
167
218
|
"placeholder": props.config.placeholder,
|
|
168
219
|
"disabled": props.disabled,
|
|
169
|
-
"clearable":
|
|
220
|
+
"clearable": props.config.clearable
|
|
170
221
|
}, componentProps.value);
|
|
171
|
-
const inputNumberProps = type === "input-number" ? __spreadProps(__spreadValues({}, commonProps), {
|
|
172
|
-
modelValue: commonProps.modelValue === "" ? null : commonProps.modelValue
|
|
173
|
-
}) : commonProps;
|
|
174
222
|
switch (type) {
|
|
175
223
|
case "input":
|
|
176
224
|
return vue.h(ElementPlus.ElInput, __spreadProps(__spreadValues({}, commonProps), {
|
|
@@ -183,98 +231,187 @@ const _sfc_main$6 = /* @__PURE__ */ vue.defineComponent(__spreadProps(__spreadVa
|
|
|
183
231
|
rows: 4
|
|
184
232
|
}));
|
|
185
233
|
case "select": {
|
|
186
|
-
const
|
|
187
|
-
return vue.h(
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
}),
|
|
193
|
-
{
|
|
194
|
-
default: () => options.map(
|
|
195
|
-
(option) => vue.h(ElementPlus.ElOption, {
|
|
196
|
-
key: option.value,
|
|
197
|
-
label: option.label,
|
|
198
|
-
value: option.value,
|
|
199
|
-
disabled: option.disabled
|
|
200
|
-
})
|
|
201
|
-
)
|
|
202
|
-
}
|
|
203
|
-
);
|
|
234
|
+
const selectProps = __spreadValues(__spreadValues({}, commonProps), componentProps.value);
|
|
235
|
+
return vue.h(ElementPlus.ElSelect, selectProps);
|
|
236
|
+
}
|
|
237
|
+
case "autocomplete": {
|
|
238
|
+
const autocompleteProps = __spreadValues(__spreadValues({}, commonProps), componentProps.value);
|
|
239
|
+
return vue.h(ElementPlus.ElAutocomplete, autocompleteProps);
|
|
204
240
|
}
|
|
205
241
|
case "datepicker":
|
|
206
|
-
return vue.h(ElementPlus.ElDatePicker,
|
|
207
|
-
type: "date"
|
|
208
|
-
}));
|
|
242
|
+
return vue.h(ElementPlus.ElDatePicker, __spreadValues(__spreadValues({}, commonProps), componentProps.value));
|
|
209
243
|
case "datetime-picker":
|
|
210
|
-
return vue.h(ElementPlus.ElDatePicker,
|
|
211
|
-
type: "datetime"
|
|
212
|
-
}));
|
|
244
|
+
return vue.h(ElementPlus.ElDatePicker, __spreadValues(__spreadValues({}, commonProps), componentProps.value));
|
|
213
245
|
case "time-picker":
|
|
214
|
-
return vue.h(ElementPlus.ElTimePicker, __spreadValues({}, commonProps));
|
|
246
|
+
return vue.h(ElementPlus.ElTimePicker, __spreadValues(__spreadValues({}, commonProps), componentProps.value));
|
|
215
247
|
case "time-select":
|
|
216
|
-
return vue.h(ElementPlus.ElTimeSelect, __spreadValues({}, commonProps));
|
|
248
|
+
return vue.h(ElementPlus.ElTimeSelect, __spreadValues(__spreadValues({}, commonProps), componentProps.value));
|
|
217
249
|
case "radio-group": {
|
|
218
|
-
const
|
|
250
|
+
const radioGroupProps = __spreadValues(__spreadValues({}, commonProps), componentProps.value);
|
|
219
251
|
return vue.h(
|
|
220
252
|
ElementPlus.ElRadioGroup,
|
|
221
|
-
|
|
253
|
+
radioGroupProps,
|
|
222
254
|
{
|
|
223
|
-
default: () =>
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
255
|
+
default: () => {
|
|
256
|
+
const options = componentProps.value.options || props.config.options || [];
|
|
257
|
+
return options.map(
|
|
258
|
+
(option) => vue.h(ElementPlus.ElRadio, {
|
|
259
|
+
key: option.value,
|
|
260
|
+
value: option.value,
|
|
261
|
+
disabled: option.disabled
|
|
262
|
+
}, {
|
|
263
|
+
default: () => option.label
|
|
264
|
+
})
|
|
265
|
+
);
|
|
266
|
+
}
|
|
232
267
|
}
|
|
233
268
|
);
|
|
234
269
|
}
|
|
235
270
|
case "checkbox-group": {
|
|
236
|
-
const options = props.config.options || [];
|
|
237
271
|
const arrayModelValue = Array.isArray(modelValue.value) ? modelValue.value : [];
|
|
272
|
+
const checkboxGroupProps = __spreadValues(__spreadProps(__spreadValues({}, commonProps), {
|
|
273
|
+
modelValue: arrayModelValue
|
|
274
|
+
}), componentProps.value);
|
|
238
275
|
return vue.h(
|
|
239
276
|
ElementPlus.ElCheckboxGroup,
|
|
240
|
-
|
|
241
|
-
modelValue: arrayModelValue
|
|
242
|
-
}),
|
|
277
|
+
checkboxGroupProps,
|
|
243
278
|
{
|
|
244
|
-
default: () =>
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
279
|
+
default: () => {
|
|
280
|
+
const options = componentProps.value.options || props.config.options || [];
|
|
281
|
+
return options.map(
|
|
282
|
+
(option) => vue.h(ElementPlus.ElCheckbox, {
|
|
283
|
+
key: option.value,
|
|
284
|
+
value: option.value,
|
|
285
|
+
disabled: option.disabled
|
|
286
|
+
}, {
|
|
287
|
+
default: () => option.label
|
|
288
|
+
})
|
|
289
|
+
);
|
|
290
|
+
}
|
|
253
291
|
}
|
|
254
292
|
);
|
|
255
293
|
}
|
|
256
294
|
case "switch":
|
|
257
|
-
return vue.h(ElementPlus.ElSwitch, __spreadValues({}, commonProps));
|
|
295
|
+
return vue.h(ElementPlus.ElSwitch, __spreadValues(__spreadValues({}, commonProps), componentProps.value));
|
|
258
296
|
case "slider":
|
|
259
|
-
return vue.h(ElementPlus.ElSlider, __spreadValues({}, commonProps));
|
|
260
|
-
case "cascader":
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
297
|
+
return vue.h(ElementPlus.ElSlider, __spreadValues(__spreadValues({}, commonProps), componentProps.value));
|
|
298
|
+
case "cascader": {
|
|
299
|
+
const cascaderProps = __spreadValues(__spreadValues({}, commonProps), componentProps.value);
|
|
300
|
+
return vue.h(ElementPlus.ElCascader, cascaderProps);
|
|
301
|
+
}
|
|
302
|
+
case "tree-select": {
|
|
303
|
+
const treeSelectProps = __spreadValues(__spreadValues({}, commonProps), componentProps.value);
|
|
304
|
+
return vue.h(ElementPlus.ElTreeSelect, treeSelectProps);
|
|
305
|
+
}
|
|
264
306
|
case "color-picker":
|
|
265
|
-
return vue.h(ElementPlus.ElColorPicker, __spreadValues({}, commonProps));
|
|
307
|
+
return vue.h(ElementPlus.ElColorPicker, __spreadValues(__spreadValues({}, commonProps), componentProps.value));
|
|
266
308
|
case "rate":
|
|
267
|
-
return vue.h(ElementPlus.ElRate, __spreadValues({}, commonProps));
|
|
268
|
-
case "input-number":
|
|
309
|
+
return vue.h(ElementPlus.ElRate, __spreadValues(__spreadValues({}, commonProps), componentProps.value));
|
|
310
|
+
case "input-number": {
|
|
311
|
+
const numberModelValue = modelValue.value === "" || modelValue.value === null || modelValue.value === void 0 ? null : Number(modelValue.value);
|
|
312
|
+
const inputNumberProps = __spreadValues(__spreadProps(__spreadValues({}, commonProps), {
|
|
313
|
+
"modelValue": numberModelValue,
|
|
314
|
+
"onUpdate:modelValue": (val) => {
|
|
315
|
+
props.model[props.field] = val;
|
|
316
|
+
}
|
|
317
|
+
}), componentProps.value);
|
|
269
318
|
return vue.h(ElementPlus.ElInputNumber, inputNumberProps);
|
|
319
|
+
}
|
|
320
|
+
// 图片上传
|
|
321
|
+
case "image-upload": {
|
|
322
|
+
const uploadProps = __spreadValues(__spreadProps(__spreadValues({}, commonProps), {
|
|
323
|
+
"action": componentProps.value.action || "#",
|
|
324
|
+
"file-list": componentProps.value.fileList || [],
|
|
325
|
+
"list-type": componentProps.value.listType || "picture-card",
|
|
326
|
+
"onPreview": componentProps.value.onPreview,
|
|
327
|
+
"onRemove": componentProps.value.onRemove
|
|
328
|
+
}), componentProps.value);
|
|
329
|
+
if (uploadProps["list-type"] === "picture-card") {
|
|
330
|
+
return vue.h(ElementPlus.ElUpload, uploadProps, {
|
|
331
|
+
default: () => vue.h("div", { class: "el-upload__picture-card-wrapper" }, [
|
|
332
|
+
vue.h(ElementPlus.ElIcon, { size: 24 }, { default: () => vue.h(index.Plus) })
|
|
333
|
+
])
|
|
334
|
+
});
|
|
335
|
+
}
|
|
336
|
+
if (uploadProps["list-type"] === "picture") {
|
|
337
|
+
return vue.h(ElementPlus.ElUpload, uploadProps, {
|
|
338
|
+
default: () => vue.h(ElementPlus.ElButton, { type: "primary" }, { default: () => "点击上传" })
|
|
339
|
+
});
|
|
340
|
+
}
|
|
341
|
+
return vue.h(ElementPlus.ElUpload, uploadProps);
|
|
342
|
+
}
|
|
343
|
+
// 文件上传
|
|
344
|
+
case "file-upload": {
|
|
345
|
+
const uploadProps = __spreadValues(__spreadProps(__spreadValues({}, commonProps), {
|
|
346
|
+
"action": componentProps.value.action || "#",
|
|
347
|
+
"file-list": componentProps.value.fileList || [],
|
|
348
|
+
"list-type": componentProps.value.listType || "text",
|
|
349
|
+
"onPreview": componentProps.value.onPreview,
|
|
350
|
+
"onRemove": componentProps.value.onRemove
|
|
351
|
+
}), componentProps.value);
|
|
352
|
+
if (uploadProps["list-type"] === "text") {
|
|
353
|
+
return vue.h(ElementPlus.ElUpload, uploadProps, {
|
|
354
|
+
default: () => vue.h(ElementPlus.ElButton, { type: "primary" }, { default: () => "点击上传" })
|
|
355
|
+
});
|
|
356
|
+
}
|
|
357
|
+
return vue.h(ElementPlus.ElUpload, uploadProps);
|
|
358
|
+
}
|
|
270
359
|
case "custom":
|
|
271
|
-
return (
|
|
360
|
+
return (_b = (_a = props.config).render) == null ? void 0 : _b.call(_a, commonProps);
|
|
272
361
|
default:
|
|
273
362
|
return vue.h(ElementPlus.ElInput, commonProps);
|
|
274
363
|
}
|
|
275
364
|
}
|
|
365
|
+
function renderHelpTooltip() {
|
|
366
|
+
if (!props.config.help)
|
|
367
|
+
return null;
|
|
368
|
+
const { help } = props.config;
|
|
369
|
+
const { text, type = "info", position = "top" } = help;
|
|
370
|
+
const iconMap = {
|
|
371
|
+
info: { icon: index.QuestionFilled, color: "var(--el-color-info)" },
|
|
372
|
+
warning: { icon: index.WarningFilled, color: "var(--el-color-warning)" },
|
|
373
|
+
success: { icon: index.CircleCheckFilled, color: "var(--el-color-success)" },
|
|
374
|
+
error: { icon: index.CircleCloseFilled, color: "var(--el-color-error)" }
|
|
375
|
+
};
|
|
376
|
+
const { icon, color } = iconMap[type];
|
|
377
|
+
return vue.h(
|
|
378
|
+
ElementPlus.ElTooltip,
|
|
379
|
+
{
|
|
380
|
+
content: text,
|
|
381
|
+
placement: position
|
|
382
|
+
},
|
|
383
|
+
{
|
|
384
|
+
default: () => vue.h(
|
|
385
|
+
ElementPlus.ElIcon,
|
|
386
|
+
{
|
|
387
|
+
style: { color, cursor: "pointer", marginLeft: "4px" },
|
|
388
|
+
size: 16
|
|
389
|
+
},
|
|
390
|
+
{ default: () => vue.h(icon) }
|
|
391
|
+
)
|
|
392
|
+
}
|
|
393
|
+
);
|
|
394
|
+
}
|
|
395
|
+
function renderHelpText() {
|
|
396
|
+
if (!props.config.help || props.config.help.tooltip)
|
|
397
|
+
return null;
|
|
398
|
+
const { text, type = "info" } = props.config.help;
|
|
399
|
+
const typeStyles = {
|
|
400
|
+
info: "bg-(--el-color-info)/10 text-(--el-color-info)",
|
|
401
|
+
warning: "bg-(--el-color-warning)/10 text-(--el-color-warning)",
|
|
402
|
+
success: "bg-(--el-color-success)/10 text-(--el-color-success)",
|
|
403
|
+
error: "bg-(--el-color-error)/10 text-(--el-color-error)"
|
|
404
|
+
};
|
|
405
|
+
return vue.h(
|
|
406
|
+
"div",
|
|
407
|
+
{
|
|
408
|
+
class: `jky-form-item__help mt-2 text-xs px-2 py-1.5 rounded ${typeStyles[type]}`
|
|
409
|
+
},
|
|
410
|
+
{ default: () => text }
|
|
411
|
+
);
|
|
412
|
+
}
|
|
276
413
|
return (_ctx, _cache) => {
|
|
277
|
-
return isHidden.value ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_1
|
|
414
|
+
return isHidden.value ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_1)) : __props.config.title && !__props.config.label ? (vue.openBlock(), vue.createBlock(vue.unref(ElementPlus.ElFormItem), vue.mergeProps({
|
|
278
415
|
key: 1,
|
|
279
416
|
prop: __props.field
|
|
280
417
|
}, __spreadValues(__spreadValues({}, formItemProps.value), _ctx.$attrs), {
|
|
@@ -282,12 +419,14 @@ const _sfc_main$6 = /* @__PURE__ */ vue.defineComponent(__spreadProps(__spreadVa
|
|
|
282
419
|
style: [__props.config.customStyle]
|
|
283
420
|
}), {
|
|
284
421
|
default: vue.withCtx(() => [
|
|
285
|
-
vue.createElementVNode("div", _hoisted_2
|
|
422
|
+
vue.createElementVNode("div", _hoisted_2, [
|
|
286
423
|
__props.config.titleRender ? (vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent(__props.config.titleRender({ model: modelValue.value, field: __props.field })), { key: 0 })) : (vue.openBlock(), vue.createElementBlock(vue.Fragment, { key: 1 }, [
|
|
287
424
|
vue.createTextVNode(vue.toDisplayString(__props.config.title), 1)
|
|
288
|
-
], 64))
|
|
425
|
+
], 64)),
|
|
426
|
+
__props.config.help && __props.config.help.tooltip ? (vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent(renderHelpTooltip()), { key: 2 })) : vue.createCommentVNode("", true)
|
|
289
427
|
]),
|
|
290
|
-
(vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent(renderComponent(__props.config.type || "input"))))
|
|
428
|
+
(vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent(renderComponent(__props.config.type || "input")))),
|
|
429
|
+
__props.config.help && !__props.config.help.tooltip ? (vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent(renderHelpText()), { key: 0 })) : vue.createCommentVNode("", true)
|
|
291
430
|
]),
|
|
292
431
|
_: 1
|
|
293
432
|
}, 16, ["prop", "class", "style"])) : (vue.openBlock(), vue.createBlock(vue.unref(ElementPlus.ElFormItem), vue.mergeProps({
|
|
@@ -296,17 +435,29 @@ const _sfc_main$6 = /* @__PURE__ */ vue.defineComponent(__spreadProps(__spreadVa
|
|
|
296
435
|
prop: __props.field
|
|
297
436
|
}, __spreadValues(__spreadValues({}, formItemProps.value), _ctx.$attrs), {
|
|
298
437
|
class: ["jky-form-item", [__props.config.className]]
|
|
299
|
-
}), {
|
|
438
|
+
}), vue.createSlots({
|
|
300
439
|
default: vue.withCtx(() => [
|
|
301
|
-
__props.config.prepend || __props.config.append ? (vue.openBlock(), vue.createElementBlock("div",
|
|
302
|
-
__props.config.prepend ? (vue.openBlock(), vue.createElementBlock("span",
|
|
440
|
+
__props.config.prepend || __props.config.append ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_4, [
|
|
441
|
+
__props.config.prepend ? (vue.openBlock(), vue.createElementBlock("span", _hoisted_5, vue.toDisplayString(__props.config.prepend), 1)) : vue.createCommentVNode("", true),
|
|
303
442
|
(vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent(renderComponent(__props.config.type || "input")))),
|
|
304
|
-
__props.config.append ? (vue.openBlock(), vue.createElementBlock("span",
|
|
305
|
-
])) : (vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent(renderComponent(__props.config.type || "input")), { key: 1 }))
|
|
443
|
+
__props.config.append ? (vue.openBlock(), vue.createElementBlock("span", _hoisted_6, vue.toDisplayString(__props.config.append), 1)) : vue.createCommentVNode("", true)
|
|
444
|
+
])) : (vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent(renderComponent(__props.config.type || "input")), { key: 1 })),
|
|
445
|
+
__props.config.help && !__props.config.help.tooltip ? (vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent(renderHelpText()), { key: 2 })) : vue.createCommentVNode("", true)
|
|
306
446
|
]),
|
|
307
|
-
_:
|
|
308
|
-
},
|
|
447
|
+
_: 2
|
|
448
|
+
}, [
|
|
449
|
+
__props.config.help && __props.config.help.tooltip ? {
|
|
450
|
+
name: "label",
|
|
451
|
+
fn: vue.withCtx(() => [
|
|
452
|
+
vue.createElementVNode("div", _hoisted_3, [
|
|
453
|
+
vue.createElementVNode("span", null, vue.toDisplayString(__props.config.label), 1),
|
|
454
|
+
(vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent(renderHelpTooltip())))
|
|
455
|
+
])
|
|
456
|
+
]),
|
|
457
|
+
key: "0"
|
|
458
|
+
} : void 0
|
|
459
|
+
]), 1040, ["label", "prop", "class"]));
|
|
309
460
|
};
|
|
310
461
|
}
|
|
311
462
|
}));
|
|
312
|
-
exports.default = _sfc_main
|
|
463
|
+
exports.default = _sfc_main;
|
package/dist/lib/index.js
CHANGED
|
@@ -6,10 +6,11 @@ const installer$1 = require("./utils/installer.js");
|
|
|
6
6
|
const resolver = require("./resolver.js");
|
|
7
7
|
const index = require("./button/index.js");
|
|
8
8
|
const index$1 = require("./button-nav/index.js");
|
|
9
|
-
const index$2 = require("./
|
|
10
|
-
const index$3 = require("./
|
|
11
|
-
const index$4 = require("./
|
|
12
|
-
const index$5 = require("./
|
|
9
|
+
const index$2 = require("./code-mirror-editor/index.js");
|
|
10
|
+
const index$3 = require("./form/index.js");
|
|
11
|
+
const index$4 = require("./menu/index.js");
|
|
12
|
+
const index$5 = require("./page-header/index.js");
|
|
13
|
+
const index$6 = require("./say-hello/index.js");
|
|
13
14
|
const installer = installer$1.createInstaller(components.components);
|
|
14
15
|
const install = installer.install;
|
|
15
16
|
const version = installer.version;
|
|
@@ -17,10 +18,11 @@ exports.components = components.components;
|
|
|
17
18
|
exports.JkyComponentLibResolver = resolver.JkyComponentLibResolver;
|
|
18
19
|
exports.JkyButton = index.JkyButton;
|
|
19
20
|
exports.JkyButtonNav = index$1.JkyButtonNav;
|
|
20
|
-
exports.
|
|
21
|
-
exports.
|
|
22
|
-
exports.
|
|
23
|
-
exports.
|
|
21
|
+
exports.JkyCodeMirrorEditor = index$2.JkyCodeMirrorEditor;
|
|
22
|
+
exports.JkyForm = index$3.JkyForm;
|
|
23
|
+
exports.JkyMenu = index$4.JkyMenu;
|
|
24
|
+
exports.JkyPageHeader = index$5.JkyPageHeader;
|
|
25
|
+
exports.JkySayHello = index$6.JkySayHello;
|
|
24
26
|
exports.default = installer;
|
|
25
27
|
exports.install = install;
|
|
26
28
|
exports.version = version;
|
|
@@ -21,7 +21,7 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
|
21
21
|
Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: "Module" } });
|
|
22
22
|
const vue = require("vue");
|
|
23
23
|
const ElementPlus = require("element-plus");
|
|
24
|
-
const _sfc_main
|
|
24
|
+
const _sfc_main = /* @__PURE__ */ vue.defineComponent(__spreadProps(__spreadValues({}, {
|
|
25
25
|
name: "JkyAside"
|
|
26
26
|
}), {
|
|
27
27
|
__name: "Aside",
|
|
@@ -41,4 +41,4 @@ const _sfc_main$4 = /* @__PURE__ */ vue.defineComponent(__spreadProps(__spreadVa
|
|
|
41
41
|
};
|
|
42
42
|
}
|
|
43
43
|
}));
|
|
44
|
-
exports.default = _sfc_main
|
|
44
|
+
exports.default = _sfc_main;
|
|
@@ -22,7 +22,7 @@ Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toString
|
|
|
22
22
|
const vue = require("vue");
|
|
23
23
|
const ElementPlus = require("element-plus");
|
|
24
24
|
const Aside_vue_vue_type_script_setup_true_lang = require("./Aside.vue.js");
|
|
25
|
-
const _sfc_main
|
|
25
|
+
const _sfc_main = /* @__PURE__ */ vue.defineComponent(__spreadProps(__spreadValues({}, {
|
|
26
26
|
name: "JkyMenu"
|
|
27
27
|
}), {
|
|
28
28
|
__name: "Menu",
|
|
@@ -126,4 +126,4 @@ const _sfc_main$3 = /* @__PURE__ */ vue.defineComponent(__spreadProps(__spreadVa
|
|
|
126
126
|
};
|
|
127
127
|
}
|
|
128
128
|
}));
|
|
129
|
-
exports.default = _sfc_main
|
|
129
|
+
exports.default = _sfc_main;
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
+
const vue = require("vue");
|
|
4
|
+
/*! Element Plus Icons Vue v2.3.2 */
|
|
5
|
+
var _sfc_main48 = /* @__PURE__ */ vue.defineComponent({
|
|
6
|
+
name: "CircleCheckFilled",
|
|
7
|
+
__name: "circle-check-filled",
|
|
8
|
+
setup(__props) {
|
|
9
|
+
return (_ctx, _cache) => (vue.openBlock(), vue.createElementBlock("svg", {
|
|
10
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
11
|
+
viewBox: "0 0 1024 1024"
|
|
12
|
+
}, [
|
|
13
|
+
vue.createElementVNode("path", {
|
|
14
|
+
fill: "currentColor",
|
|
15
|
+
d: "M512 64a448 448 0 1 1 0 896 448 448 0 0 1 0-896m-55.808 536.384-99.52-99.584a38.4 38.4 0 1 0-54.336 54.336l126.72 126.72a38.27 38.27 0 0 0 54.336 0l262.4-262.464a38.4 38.4 0 1 0-54.272-54.336z"
|
|
16
|
+
})
|
|
17
|
+
]));
|
|
18
|
+
}
|
|
19
|
+
}), circle_check_filled_default = _sfc_main48;
|
|
20
|
+
var _sfc_main50 = /* @__PURE__ */ vue.defineComponent({
|
|
21
|
+
name: "CircleCloseFilled",
|
|
22
|
+
__name: "circle-close-filled",
|
|
23
|
+
setup(__props) {
|
|
24
|
+
return (_ctx, _cache) => (vue.openBlock(), vue.createElementBlock("svg", {
|
|
25
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
26
|
+
viewBox: "0 0 1024 1024"
|
|
27
|
+
}, [
|
|
28
|
+
vue.createElementVNode("path", {
|
|
29
|
+
fill: "currentColor",
|
|
30
|
+
d: "M512 64a448 448 0 1 1 0 896 448 448 0 0 1 0-896m0 393.664L407.936 353.6a38.4 38.4 0 1 0-54.336 54.336L457.664 512 353.6 616.064a38.4 38.4 0 1 0 54.336 54.336L512 566.336 616.064 670.4a38.4 38.4 0 1 0 54.336-54.336L566.336 512 670.4 407.936a38.4 38.4 0 1 0-54.336-54.336z"
|
|
31
|
+
})
|
|
32
|
+
]));
|
|
33
|
+
}
|
|
34
|
+
}), circle_close_filled_default = _sfc_main50;
|
|
35
|
+
var _sfc_main201 = /* @__PURE__ */ vue.defineComponent({
|
|
36
|
+
name: "Plus",
|
|
37
|
+
__name: "plus",
|
|
38
|
+
setup(__props) {
|
|
39
|
+
return (_ctx, _cache) => (vue.openBlock(), vue.createElementBlock("svg", {
|
|
40
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
41
|
+
viewBox: "0 0 1024 1024"
|
|
42
|
+
}, [
|
|
43
|
+
vue.createElementVNode("path", {
|
|
44
|
+
fill: "currentColor",
|
|
45
|
+
d: "M480 480V128a32 32 0 0 1 64 0v352h352a32 32 0 1 1 0 64H544v352a32 32 0 1 1-64 0V544H128a32 32 0 0 1 0-64z"
|
|
46
|
+
})
|
|
47
|
+
]));
|
|
48
|
+
}
|
|
49
|
+
}), plus_default = _sfc_main201;
|
|
50
|
+
var _sfc_main211 = /* @__PURE__ */ vue.defineComponent({
|
|
51
|
+
name: "QuestionFilled",
|
|
52
|
+
__name: "question-filled",
|
|
53
|
+
setup(__props) {
|
|
54
|
+
return (_ctx, _cache) => (vue.openBlock(), vue.createElementBlock("svg", {
|
|
55
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
56
|
+
viewBox: "0 0 1024 1024"
|
|
57
|
+
}, [
|
|
58
|
+
vue.createElementVNode("path", {
|
|
59
|
+
fill: "currentColor",
|
|
60
|
+
d: "M512 64a448 448 0 1 1 0 896 448 448 0 0 1 0-896m23.744 191.488c-52.096 0-92.928 14.784-123.2 44.352-30.976 29.568-45.76 70.4-45.76 122.496h80.256c0-29.568 5.632-52.8 17.6-68.992 13.376-19.712 35.2-28.864 66.176-28.864 23.936 0 42.944 6.336 56.32 19.712 12.672 13.376 19.712 31.68 19.712 54.912 0 17.6-6.336 34.496-19.008 49.984l-8.448 9.856c-45.76 40.832-73.216 70.4-82.368 89.408-9.856 19.008-14.08 42.24-14.08 68.992v9.856h80.96v-9.856c0-16.896 3.52-31.68 10.56-45.76 6.336-12.672 15.488-24.64 28.16-35.2 33.792-29.568 54.208-48.576 60.544-55.616 16.896-22.528 26.048-51.392 26.048-86.592q0-64.416-42.24-101.376c-28.16-25.344-65.472-37.312-111.232-37.312m-12.672 406.208a54.27 54.27 0 0 0-38.72 14.784 49.4 49.4 0 0 0-15.488 38.016c0 15.488 4.928 28.16 15.488 38.016A54.85 54.85 0 0 0 523.072 768c15.488 0 28.16-4.928 38.72-14.784a51.52 51.52 0 0 0 16.192-38.72 51.97 51.97 0 0 0-15.488-38.016 55.94 55.94 0 0 0-39.424-14.784"
|
|
61
|
+
})
|
|
62
|
+
]));
|
|
63
|
+
}
|
|
64
|
+
}), question_filled_default = _sfc_main211;
|
|
65
|
+
var _sfc_main287 = /* @__PURE__ */ vue.defineComponent({
|
|
66
|
+
name: "WarningFilled",
|
|
67
|
+
__name: "warning-filled",
|
|
68
|
+
setup(__props) {
|
|
69
|
+
return (_ctx, _cache) => (vue.openBlock(), vue.createElementBlock("svg", {
|
|
70
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
71
|
+
viewBox: "0 0 1024 1024"
|
|
72
|
+
}, [
|
|
73
|
+
vue.createElementVNode("path", {
|
|
74
|
+
fill: "currentColor",
|
|
75
|
+
d: "M512 64a448 448 0 1 1 0 896 448 448 0 0 1 0-896m0 192a58.43 58.43 0 0 0-58.24 63.744l23.36 256.384a35.072 35.072 0 0 0 69.76 0l23.296-256.384A58.43 58.43 0 0 0 512 256m0 512a51.2 51.2 0 1 0 0-102.4 51.2 51.2 0 0 0 0 102.4"
|
|
76
|
+
})
|
|
77
|
+
]));
|
|
78
|
+
}
|
|
79
|
+
}), warning_filled_default = _sfc_main287;
|
|
80
|
+
exports.CircleCheckFilled = circle_check_filled_default;
|
|
81
|
+
exports.CircleCloseFilled = circle_close_filled_default;
|
|
82
|
+
exports.Plus = plus_default;
|
|
83
|
+
exports.QuestionFilled = question_filled_default;
|
|
84
|
+
exports.WarningFilled = warning_filled_default;
|
package/dist/lib/package.json.js
CHANGED
|
@@ -46,7 +46,7 @@ const _hoisted_12 = {
|
|
|
46
46
|
key: 0,
|
|
47
47
|
class: "jky-page-header__username text-base hidden md:block"
|
|
48
48
|
};
|
|
49
|
-
const _sfc_main
|
|
49
|
+
const _sfc_main = /* @__PURE__ */ vue.defineComponent(__spreadProps(__spreadValues({}, {
|
|
50
50
|
name: "JkyPageHeader"
|
|
51
51
|
}), {
|
|
52
52
|
__name: "PageHeader",
|
|
@@ -276,4 +276,4 @@ const _sfc_main$1 = /* @__PURE__ */ vue.defineComponent(__spreadProps(__spreadVa
|
|
|
276
276
|
};
|
|
277
277
|
}
|
|
278
278
|
}));
|
|
279
|
-
exports.default = _sfc_main
|
|
279
|
+
exports.default = _sfc_main;
|