next-element-vue 0.2.9 → 0.3.0
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/index.js +77 -35
- package/dist/index.min.js +3 -3
- package/dist/index.umd.js +76 -35
- package/dist/index.umd.min.js +3 -3
- package/dist/packages/components/crud-table/src/config.d.ts +1 -0
- package/dist/packages/components/form/src/config.d.ts +2 -0
- package/dist/packages/components/form/src/widgets/upload-image.d.ts +20 -1
- package/dist/packages/components/labelimg/index.d.ts +3 -3
- package/dist/packages/components/spin-loading/index.d.ts +1 -0
- package/dist/packages/hooks/use-locale/index.d.ts +3 -0
- package/dist/packages/locale/lang/en.d.ts +1 -0
- package/dist/packages/locale/lang/zh-cn.d.ts +1 -0
- package/dist/packages/locale/lang/zh-tw.d.ts +1 -0
- package/package.json +1 -1
package/dist/index.umd.js
CHANGED
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
/**
|
|
3
3
|
* 作 者:huangteng
|
|
4
4
|
* 邮 箱:htengweb@163.com
|
|
5
|
-
* 当前版本:0.
|
|
6
|
-
* 发布日期:2024-06-
|
|
5
|
+
* 当前版本:0.3.0 v
|
|
6
|
+
* 发布日期:2024-06-16
|
|
7
7
|
* 地 址:https://www.npmjs.com/package/next-element-vue
|
|
8
8
|
*/
|
|
9
9
|
|
|
@@ -756,7 +756,8 @@
|
|
|
756
756
|
cancelDelete: "取消删除操作",
|
|
757
757
|
confirmButtonText: "确 定",
|
|
758
758
|
cancelButtonText: "取 消"
|
|
759
|
-
}
|
|
759
|
+
},
|
|
760
|
+
uploadfileExceed: "上传文件数量超出限制范围"
|
|
760
761
|
},
|
|
761
762
|
form: {
|
|
762
763
|
input: "请输入",
|
|
@@ -830,7 +831,8 @@
|
|
|
830
831
|
cancelDelete: "Cancel delete",
|
|
831
832
|
confirmButtonText: "OK",
|
|
832
833
|
cancelButtonText: "Cancel"
|
|
833
|
-
}
|
|
834
|
+
},
|
|
835
|
+
uploadfileExceed: "The number of uploaded files exceeds the limit"
|
|
834
836
|
},
|
|
835
837
|
form: {
|
|
836
838
|
input: "please input ",
|
|
@@ -904,7 +906,8 @@
|
|
|
904
906
|
cancelDelete: "取消删除操作",
|
|
905
907
|
confirmButtonText: "確 定",
|
|
906
908
|
cancelButtonText: "取 消"
|
|
907
|
-
}
|
|
909
|
+
},
|
|
910
|
+
uploadfileExceed: "上传文件数量超出限制范围"
|
|
908
911
|
},
|
|
909
912
|
form: {
|
|
910
913
|
input: "請輸入",
|
|
@@ -3608,8 +3611,11 @@
|
|
|
3608
3611
|
class: ns.b("header-menu")
|
|
3609
3612
|
}, [ vue.createVNode("div", {
|
|
3610
3613
|
class: ns.b("header-menu-left")
|
|
3611
|
-
}, [ this.$slots["menu-left-prefix"]?.(
|
|
3614
|
+
}, [ this.$slots["menu-left-prefix"]?.({
|
|
3615
|
+
size: options.size
|
|
3616
|
+
}), options.addBtn && vue.createVNode(elementPlus.ElButton, {
|
|
3612
3617
|
type: "primary",
|
|
3618
|
+
size: options.size,
|
|
3613
3619
|
onClick: () => {
|
|
3614
3620
|
this.$emit("clickAdd");
|
|
3615
3621
|
}
|
|
@@ -3620,6 +3626,7 @@
|
|
|
3620
3626
|
default: () => t("next.table.add")
|
|
3621
3627
|
}), options.batchDelBtn && vue.createVNode(elementPlus.ElButton, {
|
|
3622
3628
|
type: "danger",
|
|
3629
|
+
size: options.size,
|
|
3623
3630
|
disabled: !multipleSelectionLength.value,
|
|
3624
3631
|
onClick: () => {
|
|
3625
3632
|
const selection = vue.unref(vue.toRaw(multipleSelection.value.map((row => vue.toRaw(row)))));
|
|
@@ -3643,10 +3650,15 @@
|
|
|
3643
3650
|
default: () => [ vue.createVNode(delete_default, null, null) ]
|
|
3644
3651
|
}),
|
|
3645
3652
|
default: () => t("next.table.batchDelete")
|
|
3646
|
-
}), this.$slots["menu-left-suffix"]?.(
|
|
3653
|
+
}), this.$slots["menu-left-suffix"]?.({
|
|
3654
|
+
size: options.size
|
|
3655
|
+
}) ]), vue.createVNode("div", {
|
|
3647
3656
|
class: ns.b("header-menu-right")
|
|
3648
|
-
}, [ this.$slots["menu-right-prefix"]?.(
|
|
3657
|
+
}, [ this.$slots["menu-right-prefix"]?.({
|
|
3658
|
+
size: options.size
|
|
3659
|
+
}), options.refreshBtn && vue.createVNode(elementPlus.ElButton, {
|
|
3649
3660
|
circle: !0,
|
|
3661
|
+
size: options.size,
|
|
3650
3662
|
onClick: () => {
|
|
3651
3663
|
this.$emit("clickRefresh");
|
|
3652
3664
|
}
|
|
@@ -3656,6 +3668,7 @@
|
|
|
3656
3668
|
})
|
|
3657
3669
|
}), options.settingBtn && vue.createVNode(elementPlus.ElButton, {
|
|
3658
3670
|
circle: !0,
|
|
3671
|
+
size: options.size,
|
|
3659
3672
|
onClick: () => {
|
|
3660
3673
|
drawerSettingRef.value.visible = !0;
|
|
3661
3674
|
}
|
|
@@ -3663,7 +3676,9 @@
|
|
|
3663
3676
|
icon: () => vue.createVNode(elementPlus.ElIcon, null, {
|
|
3664
3677
|
default: () => [ vue.createVNode(tools_default, null, null) ]
|
|
3665
3678
|
})
|
|
3666
|
-
}), this.$slots["menu-right-suffix"]?.(
|
|
3679
|
+
}), this.$slots["menu-right-suffix"]?.({
|
|
3680
|
+
size: options.size
|
|
3681
|
+
}) ]), vue.createVNode(DrawerSetting, {
|
|
3667
3682
|
ref: drawerSettingRef
|
|
3668
3683
|
}, null) ]);
|
|
3669
3684
|
}
|
|
@@ -4271,12 +4286,20 @@
|
|
|
4271
4286
|
values: [ "text", "picture", "picture-card" ],
|
|
4272
4287
|
default: "picture-card"
|
|
4273
4288
|
},
|
|
4289
|
+
multiple: {
|
|
4290
|
+
type: Boolean,
|
|
4291
|
+
default: !1
|
|
4292
|
+
},
|
|
4293
|
+
limit: {
|
|
4294
|
+
type: Number,
|
|
4295
|
+
default: 1
|
|
4296
|
+
},
|
|
4274
4297
|
accept: {
|
|
4275
4298
|
type: String,
|
|
4276
4299
|
default: "image/*"
|
|
4277
4300
|
}
|
|
4278
4301
|
},
|
|
4279
|
-
emits: [ "change" ],
|
|
4302
|
+
emits: [ "change", "exceed" ],
|
|
4280
4303
|
setup(props) {
|
|
4281
4304
|
const {appContext: appContext} = vue.getCurrentInstance(), {t: t} = useLocale();
|
|
4282
4305
|
return {
|
|
@@ -4312,6 +4335,8 @@
|
|
|
4312
4335
|
class: [ ns$7.b("upload-image"), props.className ],
|
|
4313
4336
|
style: props.style,
|
|
4314
4337
|
"list-type": props.listType,
|
|
4338
|
+
multiple: props.multiple,
|
|
4339
|
+
limit: props.limit,
|
|
4315
4340
|
"auto-upload": !1,
|
|
4316
4341
|
"on-preview": uploadFile => {
|
|
4317
4342
|
const body = document.getElementsByTagName("body")[0], initial = uploadfilesPreview.value.findIndex((file => file.url === uploadFile.url)) || 0;
|
|
@@ -4330,8 +4355,14 @@
|
|
|
4330
4355
|
});
|
|
4331
4356
|
previewImagesContainer.appContext = this.appContext, vue.render(previewComponent, previewImagesContainer);
|
|
4332
4357
|
},
|
|
4333
|
-
|
|
4358
|
+
"on-change": (uploadfile, uploadfiles) => {
|
|
4334
4359
|
uploadfilesPreview.value = uploadfiles, emit("change", uploadfile, uploadfiles);
|
|
4360
|
+
},
|
|
4361
|
+
"on-exceed": (uploadfile, uploadfiles) => {
|
|
4362
|
+
elementPlus.ElMessage({
|
|
4363
|
+
type: "info",
|
|
4364
|
+
message: _t("next.table.uploadfileExceed")
|
|
4365
|
+
}), emit("exceed", uploadfile, uploadfiles);
|
|
4335
4366
|
}
|
|
4336
4367
|
}, {
|
|
4337
4368
|
trigger: () => slots.default ? slots.default() : "picture-card" === props.listType ? vue.createVNode(elementPlus.ElIcon, null, {
|
|
@@ -4434,6 +4465,9 @@
|
|
|
4434
4465
|
}, null) ]);
|
|
4435
4466
|
}
|
|
4436
4467
|
});
|
|
4468
|
+
function _isSlot$2(s) {
|
|
4469
|
+
return "function" == typeof s || "[object Object]" === Object.prototype.toString.call(s) && !vue.isVNode(s);
|
|
4470
|
+
}
|
|
4437
4471
|
const ns$6 = useNamespace("form");
|
|
4438
4472
|
var Element$6 = vue.defineComponent({
|
|
4439
4473
|
name: "NextForm",
|
|
@@ -4476,17 +4510,17 @@
|
|
|
4476
4510
|
deep: !0,
|
|
4477
4511
|
immediate: !0
|
|
4478
4512
|
});
|
|
4479
|
-
const formColumns = arrayObjNoRepeat(_formColumns.value, "prop");
|
|
4513
|
+
const formColumns = arrayObjNoRepeat(_formColumns.value, "prop"), spanResizeLoading = vue.ref(!1);
|
|
4480
4514
|
vue.onMounted((() => {
|
|
4481
4515
|
const formEl = ruleFormRef.value?.$el;
|
|
4482
4516
|
let timer = null;
|
|
4483
4517
|
elementResize(formEl, (el => {
|
|
4484
|
-
null !== timer
|
|
4518
|
+
null !== timer ? clearTimeout(timer) : spanResizeLoading.value = !0, timer = setTimeout((() => {
|
|
4485
4519
|
colSpan.value = ((el, minWidth = 350) => {
|
|
4486
4520
|
const el_width = el.clientWidth;
|
|
4487
4521
|
let span = Math.floor(el_width / minWidth);
|
|
4488
4522
|
return span > 4 && (span = 4), Math.ceil(24 / span);
|
|
4489
|
-
})(el, options.columnMinWidth), clearTimeout(timer);
|
|
4523
|
+
})(el, options.columnMinWidth), spanResizeLoading.value = !1, clearTimeout(timer);
|
|
4490
4524
|
}), 200);
|
|
4491
4525
|
}));
|
|
4492
4526
|
}));
|
|
@@ -4777,7 +4811,10 @@
|
|
|
4777
4811
|
modelValue: formParams[col.prop],
|
|
4778
4812
|
"onUpdate:modelValue": $event => formParams[col.prop] = $event,
|
|
4779
4813
|
disabled: col.disabled,
|
|
4780
|
-
|
|
4814
|
+
multiple: col.multiple,
|
|
4815
|
+
limit: col.limit,
|
|
4816
|
+
onChange: (...arg) => col.onChange?.(...arg, col, formParams, formColumns),
|
|
4817
|
+
onExceed: (...arg) => col.onExceed?.(...arg, col, formParams, formColumns)
|
|
4781
4818
|
}, null) : "treeSelect" === col.type ? vue.createVNode(treeSelect, {
|
|
4782
4819
|
modelValue: formParams[col.prop],
|
|
4783
4820
|
"onUpdate:modelValue": $event => formParams[col.prop] = $event,
|
|
@@ -4793,19 +4830,22 @@
|
|
|
4793
4830
|
getFormInstance: () => ruleFormRef.value,
|
|
4794
4831
|
getFormParams: () => vue.toRaw(formParams)
|
|
4795
4832
|
});
|
|
4796
|
-
|
|
4797
|
-
let
|
|
4798
|
-
return vue.createVNode(
|
|
4799
|
-
|
|
4800
|
-
|
|
4801
|
-
|
|
4802
|
-
|
|
4803
|
-
|
|
4804
|
-
|
|
4805
|
-
|
|
4806
|
-
|
|
4833
|
+
return () => {
|
|
4834
|
+
let _slot2;
|
|
4835
|
+
return vue.createVNode(NextSpinLoading, {
|
|
4836
|
+
loading: spanResizeLoading.value
|
|
4837
|
+
}, _isSlot$2(_slot2 = (() => {
|
|
4838
|
+
let _slot;
|
|
4839
|
+
return vue.createVNode(elementPlus.ElForm, {
|
|
4840
|
+
ref: ruleFormRef,
|
|
4841
|
+
class: ns$6.b(),
|
|
4842
|
+
inline: !1,
|
|
4843
|
+
model: formParams,
|
|
4844
|
+
size: options.size
|
|
4845
|
+
}, {
|
|
4846
|
+
default: () => [ vue.createVNode(elementPlus.ElRow, {
|
|
4807
4847
|
gutter: 20
|
|
4808
|
-
}, (
|
|
4848
|
+
}, _isSlot$2(_slot = formColumns.map((column => !column.hide && vue.createVNode(elementPlus.ElCol, {
|
|
4809
4849
|
span: valueExist(column.span, colSpan.value)
|
|
4810
4850
|
}, {
|
|
4811
4851
|
default: () => [ vue.createVNode(elementPlus.ElFormItem, {
|
|
@@ -4835,9 +4875,9 @@
|
|
|
4835
4875
|
}) : null ]) : null,
|
|
4836
4876
|
default: () => renderFormItem(column)
|
|
4837
4877
|
}) ]
|
|
4838
|
-
})))
|
|
4878
|
+
})))) ? _slot : {
|
|
4839
4879
|
default: () => [ _slot ]
|
|
4840
|
-
})
|
|
4880
|
+
}), _isEditing.value && options.showFooter ? vue.createVNode("div", {
|
|
4841
4881
|
class: ns$6.e("footer")
|
|
4842
4882
|
}, [ vue.createVNode(elementPlus.ElButton, {
|
|
4843
4883
|
type: "primary",
|
|
@@ -4849,12 +4889,12 @@
|
|
|
4849
4889
|
onClick: onResetForm
|
|
4850
4890
|
}, {
|
|
4851
4891
|
default: () => [ t(options.resetText) || t("next.form.reset") ]
|
|
4852
|
-
}) : null ]) : null ]
|
|
4853
|
-
|
|
4854
|
-
|
|
4892
|
+
}) : null ]) : null ]
|
|
4893
|
+
});
|
|
4894
|
+
})()) ? _slot2 : {
|
|
4895
|
+
default: () => [ _slot2 ]
|
|
4855
4896
|
});
|
|
4856
4897
|
};
|
|
4857
|
-
return () => vue.createVNode(vue.Fragment, null, [ renderContent() ]);
|
|
4858
4898
|
}
|
|
4859
4899
|
});
|
|
4860
4900
|
const NextTreeSelect = withInstall(treeSelect), NextForm = withInstall(Element$6);
|
|
@@ -4956,6 +4996,7 @@
|
|
|
4956
4996
|
rules: valueExist(col.formRules, col.rules, null),
|
|
4957
4997
|
span: valueExist(col.formSpan, col.span, null),
|
|
4958
4998
|
multiple: valueExist(col.formMultiple, col.multiple, !1),
|
|
4999
|
+
limit: valueExist(col.formLimit, col.limit, 1),
|
|
4959
5000
|
dicData: valueExist(col.formDicData, col.dicData, []),
|
|
4960
5001
|
loadDicData: valueExist(col.formLoadDicData, col.loadDicData, null),
|
|
4961
5002
|
onChange: valueExist(col.onChangeForm, col.onChange, null),
|
|
@@ -6623,7 +6664,7 @@
|
|
|
6623
6664
|
})(app);
|
|
6624
6665
|
};
|
|
6625
6666
|
var index = {
|
|
6626
|
-
version: "0.
|
|
6667
|
+
version: "0.3.0",
|
|
6627
6668
|
install: install
|
|
6628
6669
|
};
|
|
6629
6670
|
exports.NextContainer = NextContainer, exports.NextCrudTable = NextCrudTable, exports.NextCrudTableVirtualized = NextCrudTableVirtualized,
|
|
@@ -6669,7 +6710,7 @@
|
|
|
6669
6710
|
}), exports.useGetDerivedNamespace = useGetDerivedNamespace, exports.useLanguage = (locale, lang) => {
|
|
6670
6711
|
const localeRef = vue.isRef(locale) ? locale : vue.ref(locale), nextLang = localeLang[lang] || localeLang["zh-cn"];
|
|
6671
6712
|
localeRef.value.name = lang, localeRef.value.next = nextLang.next;
|
|
6672
|
-
}, exports.useLocale = useLocale, exports.useNamespace = useNamespace, exports.version = "0.
|
|
6713
|
+
}, exports.useLocale = useLocale, exports.useNamespace = useNamespace, exports.version = "0.3.0",
|
|
6673
6714
|
Object.defineProperty(exports, "__esModule", {
|
|
6674
6715
|
value: !0
|
|
6675
6716
|
});
|